Saturday 10 May 2014

[Raspberry pi] RTL8188CU usb dongle driver installation and automatically connecting to wifi on boot

http://www.ebay.ca/itm/321261160362?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

purchased item
Mini USB 150M 150Mbps Wireless LAN Adapter 802.11b/n/g WiFi w/ 2dBi Antenna D1

more info
on $lsusb
ID 0bda:0179 Realtek Semiconductor Corp.

Installation of this usb dongle does not work on raspbian,
3.10.36+ #666

Following this guide,
Realtek wifi 8188CUS doesn't "just work"
http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=52236
and this original poster,
http://www.fars-robotics.net/

1. set up /etc/network/interfaces
2. set up /etc/wpa_supplicant/wpa_supplicant.conf
3. set up driver according to section... Installing the rtl8188eu based wifi adaptor driver for Raspbian.
3.1 $uname -a reveals version, which is reflected by URL date on 3.2
3.2 $wget https://dl.dropboxusercontent.com/u/80256631/8188eu-20140117.tar.gz
3.3 $tar -zxvf 8188eu-*.tar.gz
3.4 $sudo install -p -m 644 8188eu.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless
3.5 $sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8188eu.ko
3.6 $sudo depmod -a

4. modify /etc/rc.local according to following guide, **module name is different**
raspberrypi.stackexchange.com/questions/4120/how-to-automatically-reconnect-wifi
4.1 some files need to be created at /usr/local/bin/wifi, /etc/wifi.conf

5. reboot


P.S. to force connecting by commands at rc.local,
add following to /etc/rc.local, without modifying /etc/networks/interfaces or wpa_conf files
##/etc/rc.local
##for a WEP AP
iwconfig wlan0 essid APNAME key 1234567890
dhclient wlan0
#will run every boot

For linux mint 16 as well as ubuntu, this same dongle will work following this guide,
Good news re RealTek RTL-8188CUs
http://ubuntuforums.org/showthread.php?t=2042768

which is found from here,
Edimax EW-7811Un USB wireless – connecting to a network (on ubuntu 11.10)
http://www.r-statistics.com/2011/11/edimax-ew-7811un-usb-wireless-connecting-to-a-network-on-ubuntu-11-10/


Step 0: get a network cable

In order to solve this issue you will need Internet. Get a network cable which you can physically connect to your router. Once you have Internet access the following steps are much easier to follow.

Step 1: make it easy to open terminal window in a specific folder location

This step is important since it makes several other steps easier to manage.

The instructions on how to do it are given here. You simply need to open a terminal window (press CTRL+ALT+T), and type:
sudo apt-get install nautilus-open-terminal

From now on, whenever you want to open a new terminal window in a specific folder – you simply right-click that folder (from the folder which is a level above it) and choose “Open in Terminal”

Step 2: Download the latest edimx drivers
http://www.realtek.com.tw/downloads/...oads=true#2742

Step 3: Install the new driver

Go to the download folder and open (using right click, if you followed step 0) the terminal for the folder “RTL8192CU_8188CUS_8188CE-VAU_linux_v3.1.2590.20110922″. Then run:

sudo bash install.sh

(note 1: it will ask for your user’s password – as will any command which is using the sudo = super user do prefix)
(note 2: in order to paste in the terminal, use ctrl+shift+v instead of just ctrl+v as is in the GUI and other editors)

Step 4: blacklist the old driver

Next, we want to edit /etc/modprobe.d/blacklist.conf Getting there using the GUI wouldn’t work, because ubuntu wouldn’t let us save the changes we will make. Instead, just open the terminal and type:
sudo gedit /etc/modprobe.d/blacklist.conf

Go to the end of the file and add the line:

blacklist rtl8192cu

(thanks goes to icracked for the advise)

Step 5: remove and re-insert the network USB (and reboot)

Once done – I was finally able to see and connect to my home Internet network.

At this point, some people also said reboot helped, so if you got this far, why not do that too…

Thursday 1 May 2014

Turn old laptop monitor/screen lcd to make a external monitor

Source: RedFathom ( https://www.youtube.com/watch?v=r_lm1kRa1Fs&list=PL5xraSSdWblzadOLVWeN4_n3uh4AEigfe )



His sources:

Teensyduino microcontroller
http://www.pjrc.com/store/teensy.html

LVDS controller
http://www.ebay.com/sch/m.html?_odkw=&_ssn=goldpart&_nkw=gm5621

Bongofish
http://wiki.bongofish.co.uk/doku.php?id=bongofish:penenabled

Waxbee code
http://code.google.com/p/waxbee/

Teensyduino is used for serial-usb conversion of the tablet. (RedFathom)

The tablet uses a teensyduino 2.0 loaded with the waxbee script. it's just wired between D1&D2 on the teensy and 9-Rxd&10-Txd on the tablet. of course gnd-gnd vcc-vcc. i'll have to post my configuration file probably. you can find everything you need on the bongofish website it's where i found most of the info to do this. you'll probably have to take the tape off the cable since the colors vary. (RedFathom)


Model : HP TC4400 tablet

May 1, 2014:
Ordered LVDS controller (gm5621) off ebay.
Ordered teensy (2.0 without pin) off www.pjrc.com/store/teensy.html

Studied bongofish website, corresponding WACOM model# :  SU-025-C02
there are 2 types for the pins, 10 or 14 pins.

For 14 pins, identify gnd(P1 or P2), vcc(P13), usb data+(P4), usb data -(P3).
For 10 pins, identify gnd(P6), vcc(P1), rxd tab->host @19200baud (P2), txd tab<-host (P3)
**txd description is different in bongofish website, but i believe this is the correct way.


TBC...

Friday 28 March 2014

[python] google developers tutorial

https://developers.google.com/edu/python/

readable and comprehensive

[tutorialspoint] Python Extension Programming with C

http://www.tutorialspoint.com/python/python_further_extensions.htm


For your first look at a Python extension module, you'll be grouping your code into four parts:
  • The header file Python.h.
  • The C functions you want to expose as the interface from your module.
  • A table mapping the names of your functions as Python developers will see them to C functions inside the extension module.
  • An initialization function

Structure
#include <Python.h>

static PyObject *module_func(PyObject *self, PyObject *args) {
   /* Do your stuff here. */
   Py_RETURN_NONE;
}

static PyMethodDef module_methods[] = {
   { "func", (PyCFunction)module_func, METH_NOARGS, NULL },
   { NULL, NULL, 0, NULL }
};

PyMODINIT_FUNC initModule() {
   Py_InitModule3(func, module_methods, "docstring...");
}
 

Example
#include <Python.h>

static PyObject* helloworld(PyObject* self)
{
    return Py_BuildValue("s", "Hello, Python extensions!!");
}

static char helloworld_docs[] =
    "helloworld( ): Any message you want to put here!!\n";

static PyMethodDef helloworld_funcs[] = {
    {"helloworld", (PyCFunction)helloworld, 
     METH_NOARGS, helloworld_docs},
    {NULL}
};

void inithelloworld(void)
{
    Py_InitModule3("helloworld", helloworld_funcs,
                   "Extension module example!");
}
 
 
Usage
setup.py

from distutils.core import setup, Extension
setup(name='helloworld', version='1.0',  \
      ext_modules=[Extension('helloworld', ['hello.c'])])

$ python setup.py install

Usage II
#!/usr/bin/python
import helloworld

print helloworld.helloworld()

Wednesday 26 March 2014

Raspberry pi using SPI

http://www.brianhensley.net/2012/07/getting-spi-working-on-raspberry-pi.html

Original post guides through enabling RPi to connect to a micro controller.

He uses wheezy, but this works fine in nOS 2.2 as of March 2014.

I am only saving the commands required to enable it and test.

Background of SPI available at original link.

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install git

sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update
sudo chmod +x /usr/bin/rpi-update
sudo rpi-update

sudo shutdown -h now

 #After reboot, check spidev0.0 is in fact available
ls /dev/

wget http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git\;a=blob_plain\;f=Documentation/spi/spidev_test.c -O spidev_test.c

#Original link command did not have escape letter, which did not work on my pi connection through SSH, so this one includes two escapes for ;

nano spidev_test.c
#change the device to spidev0.0
gcc spidev_test.c
sudo ./a.out

#if it does not work it will print 00s
#if it does work it will print FF 40 00 95 DE AD BE EF BA AD F0 0D
#MISO and  MOSI pins needs to be connected (GPIO 9 and GPIO 10)
#Positioning PI's HDMI port towards me, SD slot on the left, USB on the right, GPIO count begins from left bottom pin [1], incrementing to right up to GPIO 13.
#Then the top row left [14], to top right [26]


Raspberry pi backup SD card using linux

I use raspberry pi model B.

Due to my unstable power supply RPi had gone through many freeze/crashes.

This sudden change in voltage can corrupt SD card easily.

Restoring SD image and pop it back in, and save some downtime.

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=91&t=46911

    sudo dd if=/dev/mmcblk0 bs=4M | gzip > /home/your_username/image.gz

    gzip -dc /home/your_username/image.gz | sudo dd bs=4M of=/dev/sdb

--

for me

sudo fdisk -l
#Showed sdcard as /dev/mmcblk0
sudo dd if=/dev/mmcblk0 bs=4M | gzip >/media/my/RPIbackup'date +%y%m%d'.gz

#To restore
sudo fdisk -l
gzip -dc /home/your_username/image.gz | sudo dd bs=4M of=/dev/mmcblk0

Thursday 13 March 2014

How to start metasploit framework in kali linux

http://docs.kali.org/general-use/starting-metasploit-framework-in-kali

http://www.fastandeasyhacking.com/manual

start the db
service postgresql start
 
check for 5432 port
ss -ant

service metasploit start

launch console
mfsconsole

launch db and metasploit on boot
update-rc.d postgresql enable
update-rc.d metasploit enable

Debian wheezy kali linux installing jdk 7 by apt-get repository

http://stackoverflow.com/questions/15543603/installing-java-7-oracle-in-debian-via-apt-get

http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html

su -
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
 
above can be simply typed/appended into /etc/apt/sources.list 
 
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install oracle-java7-installer
exit

Phoronix-Thread: PERFORMANCE OF FILESYSTEMS COMPARED (includes Reiser4 and Ext4).

http://phoronix.com/forums/showthread.php?1765-PERFORMANCE-OF-FILESYSTEMS-COMPARED-%28includes-Reiser4-and-Ext4%29

http://www.tech-analyser.com/2011/10/understanding-file-systemsntfs-fat.html



Use EXT2/3/4 format in External SD Card in Android

http://www.hackan.com.ar/2013/05/use-ext234-format-in-external-sd-card-in-android/#.Uxv7P8OycYx

In searching which file system gives best performance on SD card, above links showed up from google search

Tuesday 11 March 2014

Dreamspark download using linux, wine

https://softsilverwind.wordpress.com/2013/03/30/download-microsoft-windows-dreamspark-from-a-linux-box/

1. linux download will be given .pkg file for SDM.

2. install User Agent Switcher for firefox, set it to ie6

3. download SDM again, it will push out .msi

4. using wine install msi file

5. wine /location/SDM.exe /loc/to/sdx/*.sdx

6. should run, did not complete for me since ie6 would not install on linux mint 16 petra & after installing ie8 the SDM shows blank

Monday 10 March 2014

Downloading a whole website using linux terminal command, wget

http://community.linuxmint.com/tutorial/view/189

wget --wait=1 --limit-rate=200K -r -p -U Mozilla www.site.com/

wait option by seconds
limit rate option by Kb
-r recursive option to download everything under target
-p page requisite option to download required images, etc
-U user agent option to specify identity

Tried and works in linux mint 16 petra

D-link router, Oops! The page you requested is not available fix

In ubuntu, this page can be fixed by

1. uncheck 'enable DNS relay'

2. flush dns

sudo apt-get install nscd
sudo /etc/init.d/nscd restart

3. if above can't be done unplug router for 1 min and reconnect

http://askubuntu.com/questions/414826/how-to-flush-dns-in-ubuntu-12-04
sudo /etc/init.d/dns-clean restart
sudo /etc/init.d/networking force-reload
sudo /etc/init.d/nscd restart
sudo /etc/init.d/dnsmasq restart
sudo /etc/init.d/named restart
sudo rndc restart     

http://forums.opendns.com/comments.php?DiscussionID=14212
using open dns

Sunday 9 March 2014

Ubuntu 12.04.4 LTS Installing JDK 7

http://askubuntu.com/questions/183867/how-do-i-update-oracle-java-7-jdk-and-jre

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
sud 
sudo update-java-alternatives -s java-7-oracle

Saturday 8 March 2014

Running vmware vmdk file in virtualbox

http://techathlon.com/how-to-run-a-vmdk-file-in-oracle-virtualbox/

Kali linux provides virtual machine release.

Download zip, check sha1sum.

Unzip the files into a virtualbox hdd folder.

Create a new machine in virtualbox using 'existing hard drive'.

Select .vmdk file as the hard disk.

Run.

ssh warning possible DNS spoofing remote host identification has changed

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The ECDSA host key for hennah has changed,
and the key for the corresponding IP address xxx.xxx.xxx.xxx
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!

It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff.
Please contact your system administrator.
Add correct host key in /home/username/.ssh/known_hosts to get rid of this message.

Offending ECDSA key in /home/username/.ssh/known_hosts:9
ECDSA host key for hennah has changed and you have requested strict checking.
Host key verification failed.

http://security.stackexchange.com/questions/10532/ecdsa-keys-changed-ssh-insecure-now

 https://www.digitalocean.com/community/questions/how-can-i-get-rid-of-warning-remote-host-identification-has-changed

ssh-keygen -R [HOSTNAME]
ssh-keygen -R [ip_address]

Friday 7 March 2014

Creating Fedora 19 boot script for synergy

http://forums.fedoraforum.org/showthread.php?t=295309
http://coreymaynard.com/blog/creating-a-custom-initd-script-on-fedora/


After installing synergy, starting server on each boot can be convenient.

So $ls /etc/rc.d/ and there was no rc.local.

#cat /etc/rc.d/init.d/README; says use systemctl

However, making rc.local under rc.d/ directory should still work.

#touch /etc/rc.d/rc.local
#nano /etc/rc.d/rc.local

#!/bin/bash
# this start script will run synergy
synergys -c /etc/synergy.conf
logger "Synergy server has started"

save and exit

#chmod +x /etc/rc.d/rc.local

then reboot

Ubuntu 12.04.4 Linux mint 16 petra installing flash plugin

sudo apt-get install flashplugin-installer


Monday 3 March 2014

[synergy] Share one set of mouse and keyboard over multiple computers

www.yodi.sg/setup-synergy-server-and-client-multiple-screen-fedora-core-17/

My setup involves a main box (2 monitors)- then my laptop (3rd external monitor) plugged into one router.

Since my desk space is limited, sharing inputs across different system comes handy.

Using Synergy, KVM switch like environment can be set up over the network.

Main box has fedora; 192.168.0.1 (will be server)
Laptop has ubuntu 12.04.4; 192.168.0.2 (will be client)

1. Install synergy
sudo yum install synergy
sudo apt-get install synergy

2. Setup server (on fedora 19)
sudo nano /etc/sysconfig/network #give two computers different hostname
sudo nano /etc/hosts #now there is no need to type ip every time

#synergy hostname setup
192.168.0.1 master0
192.168.0.2 node0
#Ctrl-X save-Y and exit

Save everything and restart or
sudo service network restart

2.1 configure synergy
sudo touch /etc/synergy.conf
sudo nano /etc/synergy.conf

section: screens
    master0:
    node0:
end

section: aliases
    master0:
        localhost.localdomain
    node0:
        192.168.0.2
end

section: links
    master0:
        right = node0
    node0:
        left = master0
end

#save and exit

2.2 run the server
synergys -f --config /etc/synergy.conf
#put it in a boot script without -f, so it can run as a daemon

3. run the client
synergyc -n node0 master0
#put this line in a startup application or /etc/init.d/rc.local
#so it will connect to the server automatically every boot up
#this line in a boot script doesn't work for 1.4+, taskbar is not available error
#will work with synergy 1.3.8, protocol version 1.3

Setting up samba server in ubuntu 12.04

http://www.allaboutlinux.eu/how-to-install-samba-server-on-ubuntu/

1. ssh into the server
2. sudo apt-get update && sudo apt-get install samba
3. cp /etc/samba/smb.conf ~
4. sudo nano /etc/samba/smb.conf

#
[global]
workgroup = Workgroup
server string = My Samba Share %v
security = user
map to guest = bad user
dns proxy = no
#
[ShareFolder]
comment = This is a folder accessible from everyone
path = /sharefolder
browsable = yes
guest ok = yes
read only = no
create mask = 0755

sudo chown -R nobody:nogroup /sharefolder/
sudo chmod 755 /sharefolder/
sudo /etc/init.d/smbd restart
 ---------------------------------------Public folder above

sudo useradd testuser01
sudo smbpasswd -a testuser01 (specify password)

sudo mkdir /testuser01
sudo chown -R testuser01 /testuser01
sudo chmod 755 /testuser01

sudo nano /etc/samba/smb.conf
#
[testuser01directory]
comment = useronly
path = /testuser01
browsable = yes
guest ok = no
read only = no
create mask = 0755

sudo service smbd restart

--------------------------------User only folder above


Korean input in ubuntu 13.10 linux mint 16

http://klein.tistory.com/515

I used to use ibus input to type in Korean.

With my current version of linux mint right-ALT (hangul) button does not toggle between English and Korean.

Installing nabi resolves this problem.

1. Ubuntu Software Centre - search nabi - install

2. Input Method - choose 'Hangul'

3. Restart xserver

Sunday 16 February 2014

Ubuntu power putton behavior shutoff to popup context menu

http://askubuntu.com/questions/362914/how-to-prevent-the-power-button-to-shutdown-directly-the-system

http://askubuntu.com/questions/385706/etc-acpi-powerbtn-sh-for-full-shutdown-menu/385716#385716

$sudo nano /etc/systemd/logind.conf

Uncomment 'HandlePowerKey=ignore', save and exit.

$sudo nano /etc/acpi/powerbtn.sh

Last line reads /sbin/shutdown -h now "Power button pressed"
Comment it out, and add new line

gnome-session-quit --power-off

Save and exit.

sudo restart systemd-logind
 -----------------------------------
No response following the post,

$whereis gnome-session-quit
$sudo nano /etc/acpi/powerbtn.sh

fixed the line to read /usr/bin/gnome-session-quit --power-off




Thursday 13 February 2014

How to see all the history of commands ever typed in a log file

http://askubuntu.com/questions/23057/i-would-like-to-create-a-log-of-all-commands-typed-in-terminal

$nano ~/.bash_history


type CTRL+R in terminal and give a keyword, then repeat CTRL+R for next search



http://www.cyberciti.biz/faq/clear-the-shell-history-in-ubuntu-linux/

To clear the history,
$history -c
or
$sudo rm ~/.bash_history


To clear history each log out
$echo 'history -c' >> ~/.bash_logout


Never create a history file
$echo 'unset HISTFILE' >> ~/.bashrc 
$echo 'export LESSHISTFILE="-"' >> ~/.bashrc

Ubuntu 12.04.4 LTS setup vncserver ssh server

on ubuntu system,

$sudo apt-get install openssh-server
$sudo apt-get install gnome-core
$sudo apt-get install vnc4server

then configure


tools;
vncviewer
putty


http://rbgeek.wordpress.com/2012/06/25/how-to-install-vnc-server-on-ubuntu-server-12-04/

Wednesday 12 February 2014

Reinstalling grub2 after installing an OS on a new partition

On my test system there is linux mint 16, and just finished installing kali.

I made a mistake of overwriting grub on /dev/sda and this has inverted boot order.

Boot order can be changed easily, but instead I want the original boot loader list provided by linux mint.

https://help.ubuntu.com/community/Grub2/Installing

So, boot into the mint 16, I just want to overwrite everything for simplicity.

$sudo grub-install /dev/sda

/usr/sbin/grub-bios-setup: warning: Sector 50 is already in use by the program 'FlexNet'; avoiding it.
This software may cause boot or other problems in future.
Please ask its authors not to store data in the boot track.
Installation finished. No error reported.

$sudo reboot

Now on the boot list, there is no kali install, but the original list shows.

On booting into mint,

$sudo update-grub
$sudo reboot


Now kali shows up as 'Debian GNU/Linux (Kali Linux 1.0.6)'

Fedora 20 Setup mail server for receiving admin alerts

SELinux Alert Browser popped with a dac_override error.

In notifying admin (for my own record so I can look at it later),

evolution needs to be set up.

All notification will be sent to my own computer; thus needs mail server.

http://servers.hostik.com/instructions/rhel-mailserver.htm

followed this procedure to set up.

And more information here,

http://docs.fedoraproject.org/en-US/Fedora/18/html/System_Administrators_Guide/s2-email-mta-sendmail.html

Tuesday 11 February 2014

Fedora 20 make nemo instead of nautilus for default file manager

http://forums.fedoraforum.org/showthread.php?t=293444

$ sudo yum install nemo -y
$ nano ~/.local/share/applications/mimeapps.list

add this line
[Added Associations]
inode/directory=nemo.desktop;nautilus.desktop;

save

Monday 10 February 2014

How to detect / defend against man in the middle MITM attack?

http://security.stackexchange.com/questions/6437/how-would-one-fully-protect-himself-against-man-in-the-middle-attacks

hp tablet tc4200 wireless hardware switch does not work in ubuntu 12.04.4 lts

Initially I thought there was no driver,

Tried to reinstall all the drivers from the hp website in windows.

http://techie-buzz.com/foss/wifi-ubuntu-install-broadcom-drivers.html
This seem irrelevant because my wifi adapter was intel 2200

However this worked.
http://askubuntu.com/questions/9816/wireless-shows-up-as-disabled-how-can-i-get-it-working

on terminal,
$sudo rfkill unblock all

This resolved the problem.
if problem persists, edit /etc/rc.local and add line "rfkill unblock all" above exit 0


More info
 http://ubuntuforums.org/showthread.php?t=1781350&page=2
http://ubuntuforums.org/showpost.php?p=10745874&postcount=4

Friday 7 February 2014

installing skype on fedora 20

http://www.if-not-true-then-false.com/2012/install-skype-on-fedora-centos-red-hat-rhel-scientific-linux-sl/

this guy also has lots of cool stuff on his blog too

Wednesday 5 February 2014

Changing environment variable for fedora 20

$nano ~/.bashrc

add following line

export PATH=$PATH:/path/to/dir

Ctrl+x, save and exit

$source ~/.bashrc

$echo $PATH

http://unix.stackexchange.com/questions/42146/changing-an-environment-variable-like-path-forever

https://ask.fedoraproject.org/en/question/24028/how-to-set-environment-variable-permanet/
difference between per-interactive-shell script / login shell

Monday 3 February 2014

VirtualBox on fedora 20 kernel driver not installed (rc=-1908)

http://forums.fedoraforum.org/showthread.php?t=237427

su
yum install kernel-devel gcc gcc-c++ make automake
yum groupinstall 'Development Tools'
/etc/init.d/vboxdrv setup

still not working

Thursday 23 January 2014

Fedora 20 enable mp3 play

http://studyhat.blogspot.ca/2013/12/fedora-20-heisenbug-post-installation.html


#yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-20.noarch.rpm
#yum localinstall --nogpgcheck http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-20.noarch.rpm


#rpm -ivh http://rpm.livna.org/livna-release.rpm
#rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-livna


#yum install gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly

link also provides how to enable flash videos and more

Wednesday 22 January 2014

How to display date in top panel on fedora 20

https://ask.fedoraproject.org/en/question/10826/how-to-display-date-on-panel/

In fedora 20 type following in command (same command as fedora 19 from link)

gsettings set org.gnome.desktop.interface clock-show-date true

Monday 20 January 2014

Installation guides/ideas of hackintosh on thinkpad (e.g. OS X 10.6 on t400s)

This article captured idea from this article;
forum.thinkpads.com/viewtopic.php?f=32&t=111976

Which cites;
http://www.tonymacx86.com/374-unibeast-install-os-x-mavericks-any-supported-intel-based-pc.html

Where step-by-step guide is provided;
tonymacx86.blogspot.ca/2010/04/iboot-multibeast-install-mac-os-x-on.html

------------------------------------------------workaround
linuxforums.org.uk/index.php?topic=1072.0
on ubuntu 10.04 lucid / 12.04.3 LTS / 13.10 with gparted, hfsplus hfsutils hfsprogs dmg2img

1. burn dmg imagefile from retail cd on USB
$dmg2img snowleopard.dmg snowleopard.img
$hexdump -C snowleopard.img | grep "48 2b 00 04"
(convert 00000400_hex into decimal = 1024, then subtract 1024 from this decimal number to calculate offset, which is 000000 in this case) 
$sudo losetup -o 000000 /dev/loop0 snowleopard.img
$sudo mkdir /media/userID/test
$sudo mount -t hfsplus /dev/loop0 /media/userID/test/

prepare a 8GB+ usb drive, format using gparted, give MBR scheme, give 8GB partition for image formatted as hfs+, mount at /media/userID/imgTarget/

$sudo cp -r /media/userID/test/* /media/userID/imgTarget/
Fix /Library/Preferences/SystemConfiguration/com.apple.Boot.plist
kernel flags string to : rdisk0s1 (1st disk, 1st slice)

2. installation
a. burn iBoot image on CD, or on USB using multiboot (not verified)
b. boot iBoot with imgTarget usb plugged in
c. choose 'mac' and boot from it
d. once booted, run diskutil from Utilities-Disk Utility
e. partition hard drive to GUID Partition Table
f. format a target partition to Mac OS Extended
 

Tuesday 14 January 2014

Ubuntu 12.04 13.10 unmanaged wifi fix

sudo nano /etc/NetworkManager/NetworkManager.conf
ifconfig wlan0 down|up
sudo service network-manager restart

Ubuntu 12.04 13.10 how to restart cinnamon desktop manager

change tty1-7 - CTRL+ALT+(F1-F7)

killall -9 cinnamoN

export DISPLAY=:0; cinnamon &

cinnamon --replace --clutter-display=:0 2> /dev/null &

Ubuntu 13.10 desktop cinnamon clonezilla image mounting to retrieve file

for beginner setup backup ext4 partition

1. sudo apt-get install partclone
(my fingerprint setup did not work correctly, so sudo nemo and closed first for sustained sudo without having to enter password)

2. sudo cat /path/to/source/sda2.ext4-ptcl-image.gz.* | sudo gzip -d -c | sudo partclone.restore -C -s - -o /path/to/target/sda2.img

3. sudo e2fsck -f partclone_extfs.img

4. sudo resize2fs partclone_extfs.img

5. sudo mount -o loop -t ext4 /source/sda2.img /media/user/target/


------------------------------------------------------------------------------------
http://community.spiceworks.com/how_to/show/39287-mount-a-clonezilla-image

http://askubuntu.com/questions/236263/browse-img-without-mounting

http://ubuntuforums.org/showthread.php?t=2007760

http://drbl.sourceforge.net/faq/fine-print.php?path=./2_System/68_manually_partclone_restore.faq#68_manually_partclone_restore.faq

http://blog.christosoft.de/2012/05/mount-clonezilla-image-to-restore-single-file-browse/
------------------------------------------------------------------------------------

1. find out type of image

file /path/to/image/sda2.ext4-ptcl-image.gz.aa

2. combine image
(had to install partclone before this step, sudo apt-get install partclone)

sudo cat sda2.ext4-ptcl-image.gz.* | sudo gzip -d -c | sudo partclone.restore -C -s - -o /path/to/target/sda2.img

3. mount

sudo mount -o loop -t ext4 /path/to/source/sda2.img /media/name/target/folder/

**i can not mount ext4 partition image with following error
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

**resolution
http://askubuntu.com/questions/91985/difficulty-trying-to-mount-an-iso-file-mount-you-must-specify-the-filesystem-t

**this person had the same problem with no resolution
http://sourceforge.net/mailarchive/forum.php?thread_name=4C8212EB.4040009%40nt.tuwien.ac.at&forum_name=clonezilla-live

**Following link works for NTFS partition which is same as above christosoft method
http://gpio.kaltpost.de/?p=616

**
 **** SUCCESSFUL RESOLUTION by jao_madn****
http://ubuntuforums.org/showthread.php?t=872832&page=3

1. check image
e2fsck -f partclone_extfs.img
2. resize blocks
resize2fs partclone_extfs.img
3. mount
mount -o loop -t ext4 <mount_image> <mount_point>

jao_madn also tried to convert image to vdi and mounted successfully using virtualbox.


*** FOR NTFS IMAGES ***
$ sudo ntfs-3g sda2.img /mnt/ba

Monday 13 January 2014

ubuntu 12.04.03 LTS t400s cinnamon icons does not appear


http://askubuntu.com/questions/386835/cinnamon-icons-doesnt-appear


sudo apt-get install gnome-icon-theme-full


------------------------------------------------------------------------
installing cinnamon on ubuntu 12.04.4LTS

http://community.linuxmint.com/tutorial/view/1246

sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
sudo apt-get update
sudo apt-get install cinnamon

ubuntu 12.04.03 LTS thinkpad t400s fingerprint reader

http://fcns.eu/2012/04/29/fingerprint-reader/


sudo add-apt-repository ppa:fingerprint/fingerprint-gui

sudo apt-get update

sudo apt-get install libbsapi policykit-1-fingerprint-gui fingerprint-gui

(re-login)

fingerprint-gui
sudo add-apt-repository ppa:fingerprint/fingerprint-gui sudo apt-get update - See more at: http://fcns.eu/2012/04/29/fingerprint-reader/#sthash.3olqUbaI.dpuf
sudo add-apt-repository ppa:fingerprint/fingerprint-gui sudo apt-get update - See more at: http://fcns.eu/2012/04/29/fingerprint-reader/#sthash.3olqUbaI.dpuf
 

ubuntu 12.04.3 LTS fresh install cinnamon crash on login fix

http://askubuntu.com/questions/339163/cinnamon-crashing-on-logon-12-04
Installing cinnamon 2.0+

sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
sudo apt-get update
sudo apt-get install cinnamon

Thursday 9 January 2014

How to open and screw back in macbook pro properly

http://forums.macrumors.com/showthread.php?t=1263708

Screwing back the bottom panel of macbook pro after RAM/HDD upgrade or replacement.

The screws can stick out and not go in all the way because six screws not along the hinge edge goes in angle.

http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1270/HT1270_1a-mbp_13-remove_back_screws-001-en.png

Start from left top corner, then right bottom corner, going clockwise until finished.

Tightening them without making such 'star patter' may misalign the panel and screws could stick out.

Wednesday 8 January 2014

ubuntu 13.10 linux korean input method ibus

http://en.kioskea.net/faq/1140-installing-truetype-fonts-under-ubuntu

go to system settings - language support
add language - korean

go to system settings - region and language
@input source, click +, select korean

Ctrl+Alt+T, opens up terminal
ibus-setup and enable custom input

(does not work apparently)

Tuesday 7 January 2014

ubuntu 13.10 linux vlc korean subtitle

http://www.alivenotdead.com/kungfutofu/--profile-323397.html
http://en.kioskea.net/faq/1140-installing-truetype-fonts-under-ubuntu


1. download ttf font and install

https://launchpad.net/ubuntu/oneiric/+source/ttf-baekmuk
tar -zxvf ttf*
sudo mkdir /usr/share/fonts/baekmuk
sudo mv ./ttf* /usr/share/fonts/baekmuk
fc-cache -fv

2. set up font from vlc preferences
tools-preferences-subtitles: default encoding (Korean, euc-kr/cp949)
font: baekmuk gulim

save and restart vlc

Monday 6 January 2014

ubuntu 13.10 touchpad tap does not click

synclient tapbutton1=1

ubuntu 13.10 window minimize maximize close button left to right side

http://www.itworld.com/software/354017/move-minimize-maximize-and-close-window-buttons-right-ubuntu-1304

gsettings set org.gnome.desktop.wm.preferences button-layout ':minimize,maximize,close'

Sunday 5 January 2014

Ubuntu 13.10 saucy salamander fresh install - android development environment setup

For some reason .ova file from original author could not load,

http://forum.xda-developers.com/showthread.php?t=2585828


here is the step-by-step guide by original author + link

http://soupdawg.wordpress.com/

http://forum.xda-developers.com/showthread.php?t=2464683


From fresh install of U13.10

sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-java6-installer
java -version (should show java version "1.6.0_45" Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode))

sudo apt-get install git-core lzop ccache gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python gcc g++ cpp gcc-4.8 g++-4.8
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

(package is done)

mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo

sudo nano ~/.bashrc
(Insert this line at the end) export PATH=~/bin:$PATH
source ~/.bashrc
mkdir ~/android
cd ~/android

repo init -u git://github.com/AOKP/platform_manifest.git -b jb-mr2 (this is for AOKP jelly bean mr2)
repo sync (this will download 10GB+)




***

metalspring
hmm...all good except repo doesnt seem to work with
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
but it does with
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
from http://source.android.com/source/downloading.html

***

metalspring
instructions are right on the aokp platform manifest page-

Init repo only for a particular device :
$ repo init -u https://github.com/AOKP/platform_manifest.git -b jb-mr2 -g all,-notdefault,<devicename>,<vendorname>

for example, to init only trees needed to build mako :
$ repo init -u https://github.com/AOKP/platform_manifest.git -b jb-mr2 -g all,-notdefault,mako,lge