Monday 23 December 2013

mac apm time machine external hard drive backup disk corrupt

Time machine drkive has unpartitioned info from disk util. Probably corrupt or overwritten with MBR by my Ubuntu system while mounted rw with hfsprogs

On testdisk showed two partitions and data partition intacintact.

Installing ext2 reader and gdisk on Mac allowed mounting of the drive again


http://www.google.ca/search?site=&source=hp&ei=0ua3UsSvPNGY2gWlsIHYBA&q=how+to+restore+time+machine+partition+table&oq=how+to+restore+time+machine+partition+table&gs_l=mobile-gws-hp.12...1571.15596.0.16782.44.44.0.20.20.3.620.11457.0j12j23j6j1j2.44.0....0...1c.1.32.mobile-gws-hp..7.37.4211.I941UTUuKCI

http://theducks.org/2010/12/fixing-gpt-partition-tables-for-osx/

http://help.bombich.com/kb/troubleshooting/cloning-a-time-machine-backup

http://rosssimpson.com/blog/2012/08/12/recovering-from-an-external-drive-failure-on-mac/




http://www.google.ca/search?biw=360&bih=302&ei=aES3UuaFB6qA2QXE6IHIDg&q=restore+corrupted++time+machine+external+hard+drive+partition+table&oq=restore+corrupted++time+machine+external+hard+drive+partition+table&gs_l=mobile-gws-serp.3...15085.28319.0.29039.11.11.0.0.0.0.124.853.10j1.11.0....0...1c.1.32.mobile-gws-serp..11.0.0.J0qw1UulXIY


http://perrohunter.com/repair-a-mac-os-x-hfs-partition-table/

Saturday 30 November 2013

Linux Mint 15 Mate installing ruby via RVM

http://rubyflewtoo.blogspot.ca/2012/07/installing-rvm-on-linux-mint-13.html

on terminal:

$sudo apt-get install curl
$curl -L https://get.rvm.io | bash -s stable --ruby

this should resolve all the dependencies itself too

$which ruby
keith@keith-ThinkPad-T420s ~ $ which ruby
/usr/bin/ruby

$ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

Saturday 23 November 2013

linux mint 15 mate thinkpad t420s laptop lid closing suspend instead of blank

sudo nano /etc/acpi/lid.sh
comment out . /usr/share/acpi-support/screenblank

http://lineatatime.blogspot.ca/2013/06/linux-mint-15-suspend-when-laptop-lid.html

http://superuser.com/questions/466899/mint-13-does-nothing-when-laptop-lid-is-closed

Linux Mint 15 Mate haskell install

sudo apt-get install haskell-platform
did not work with error - unable to locate

http://www.haskell.org/platform/linux.html

1.download the source file directly
2.install ghc before installing haskell-platform
3.unzip all the archives and cd into the folder
./configure
make
make install

--above did not work
http://forums.linuxmint.com/viewtopic.php?f=47&t=139641

http://niket-kumar.blogspot.ca/2013/05/ubuntu-1304-how-to-setup-haskell.html

http://askubuntu.com/questions/288201/cannot-determine-current-directory-while-building-haskell-in-13-04

fix:
sudo apt-get install -y libgmp3-dev freeglut3 freeglut3-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10 /usr/lib/libgmp.so.3
 
then configure and make install  

Linux command line network status monitor

sudo apt-get install iftop

iftop is a util which monitors network traffic like top for processes

Linux Mint 15 Mate on Thinkpad T420s enabling fingerprint sensor

http://tryitnw.blogspot.ca/2013/02/easy-steps-to-enable-finger-print.html
http://www.brankovukelic.com/2013/01/setting-up-fprintd-with-pam-on-linux.html
https://wiki.archlinux.org/index.php/Fprint

lsusb - look for Upek

sudo add-apt-repository ppa:fingerprint/fprint
sudo apt-get update
sudo apt-get install libpam-fprintd

grep fprint /etc/pam.d/common-auth - look for auth [success=3 default=ignore]

fprintd-enroll - enroll fingerprint

Linux Mint 15 Mate enable korean font and movie subtitles on vlc

1. download font
https://launchpad.net/ubuntu/+source/ttf-baekmuk/2.2-2
2. unzip
3. copy to /usr/share/fonts
4. sudo chmod 0755 /usr/share/fonts/NEWADDEDFONT
5. fc-cache -f -v
6. vlc preferences - subtitles - rendering font: gulim
7. vlc preferences - subtitles - encoding KOR (EUC-KR)
8. restart vlc, open video, drag-and-drop the subtitle file on the video




http://forums.bodhilinux.com/index.php?/topic/2955-how-to-install-korean-fonts-and-input/

https://forum.videolan.org/viewtopic.php?f=2&t=8660

http://www.alivenotdead.com/kungfutofu/--profile-323397.html

http://forums.fedoraforum.org/showthread.php?p=1629656

Linux Mint 15 Mate terminal background

http://forums.linuxmint.com/viewtopic.php?f=208&t=94616

when enabling terminal to become transparent
Terminal-Edit-Profile Preferences-Background-Transparency
terminal shows desktop wallpaper instead of the windows below

->Needs to enable composting
Menu-Preferences-Desktop Settings-Windows-check 'Use composting'

Wednesday 6 November 2013

Setting up Beowulf cluster with ubuntu 12.10 tutorial

1. install ubuntu 12.10 server 64bit to master/nodes with SSH(USB drives)
2. login to recovery mode (grub), get root, adduser mpiuser --uid 999, adduser mpiuser sudo, reboot
3. login to mpiuser, fix network delay, sudo nano /etc/init/failsafe.conf, reduce sleep time, save
3a. sudo nano /etc/network/interfaces
auto wlan0
iface wlan0 inet dhcp
  wpa-ssid nameofwireless
  wpa-psk passphrase

auto eth0
iface eth0 inet dhcp
3b.  sudo nano /etc/hosts #set names for the master and nodes
192.168.x.1    master
192.168.x.2    node1
192.168.x.3    node2

4. sudo nano /etc/rc.local, add service networking restart before exit 0, save
4a. if can not access network adapter, sudo ifconfig eth0 up, sudo ifconfig wlan0 up, sudo iwconfig wlan0 essid 'wirelessname', sudo ifconfig eth0 192.168.x.1, sudo ifdown wlan0 && sudo ifup wlan0

5. restart -> now the server will automatically connect to network, SSH opens

 now get rid of cdrom sources
sudo nano /etc/apt/sources.list #comment out deb cdrom:

 6. sudo apt-get install nfs-kernel-server #for the master, sudo apt-get install nfs-common #for all other nodes

7. share /home/mpiuser #of master, using /etc/exports,
sudo nano/etc/exports #add line
/home/mpiuser *(rw,sync,no_subtree_check), save
sudo service nfs-kernel-server restart
#change in /etc/exports -> sudo exportfs -a
sudo ufw allow from 192.168.x.0/24 # allow connection from local





sources
http://byobu.info/article/Building_a_simple_Beowulf_cluster_with_Ubuntu/

Saturday 19 October 2013

Using Haskell in Arch Linux (virtualbox machine under ubuntu 13.04)

1. Install U13.04
2. Install virtualbox
3. Install Arch 13.10 under virtual box
guide: https://wiki.archlinux.org/index.php/Official_Arch_Linux_Install_Guide
guide2: https://wiki.archlinux.org/index.php/Beginners%27_Guide

once arch.live is loaded,
# loadkeys us
# setfont Lat2-Terminus16
# nano /etc/locale.gen
uncomment en_US.UTF-8 UTF-8
# locale-gen
# export LANG=en_US.UTF-8
run dhcp service to get ip
# systemctl enable dhcpcd.service
# ping www.google.com -c 3
check if ip is received
GPT did not work smoothly, so using MBR
# fdisk /dev/sda
enter o
enter p
enter 1
enter 2048
enter xxxxxxxx length of partition
    and so on until all partitions created
enter p to preview
type w to write
enter q to quit
# mkfs.ext4 /dev/sda1
# lsblk /dev/sda
shows partition
# mount /dev/sda1 /mnt
# nano /etc/pacman.d/mirrorlist
find an appropriate mirror, Alt+6 to copy line, Ctrl+U to paste line, Ctrl+X, save and exit
# pacstrap -i /mnt base
# genfstab -U -p /mnt >> /mnt/etc/fstab
# nano /mnt/etc/fstab
check if the last field is 1

# arch-chroot /mnt
or arch-chroot /mnt /bin/bash
# nano /etc/locale.gen
uncomment en_US.UTF-8 UTF-8
# locale-gen
# echo LANG=en_US.UTF8 UTF-8 > /etc/locale.conf
# export LANG=en_US.UTF8
# loadkeys us
# setfont Lat2-Terminus16
# nano /etc/vconsole.conf
 KEYMAP=us
 FONT=Lat2-Terminus16
# ln -s /usr/share/zoneinfo/America/Toronto /etc/localtime
# hwclock --systohc --utc
# echo archTest > /etc/hostname
# systemctl enable dhcpcd.service
# cd /etc/netctl
# cp examples/ethernet-dhcp my_network
# nano my_network
configure accordingly
# netctl enable my_network
for wireless, AFTER reboot not as a chroot, OR just configure as above
# pacman -S iw wpa_supplicant
# pacman -S dialog
# wifi-menu  wlan0
# mkinitcpio -p linux
# nano /etc/mkinitcipo.conf
 MODULES="virtio virtio_blk virtio_pci virtio_net"
# passwd
set root passwd
# pacman -S grub
# grub-install --target=i386-pc --recheck /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg
# exit

# umount -R /mnt
# reboot

4. Install Haskell
guide:https://wiki.archlinux.org/index.php/Haskell_package_guidelines

# nano /etc/pacman.conf
add following lines before [extra]
 [haskell-core]
 Server = http://xsounds.org/~haskell/core/$arch
 [haskell-happstack]
 Server = ftp://noaxiom.org/$repo/$arch
 [haskell-web]
 Server = http://archhaskell.mynerdside.com/$repo/$arch
save and exit to add keys
# pacman-key -r 4209170B
# pacman-key --lsign-key 4209170B
# pacman-key -r B0544167
# pacman-key --lsign-key B0544167
# pacman -Syy
force refresh all package list



Monday 7 October 2013

Set up raspberry pi wifi dongle wireless manually command line

Ralink RT5370 on Raspberry Pi wheezy linux

On terminal;

uname -a
3.6.11+

sudo dmesg
 Error - Invalid RF chipset / Error - Failed to allocate device -> go to "svay.com" link
sudo nano /etc/modprobe.d/blacklist.conf (check here on error)
sudo nano /etc/modprobe.d/raspi-blacklist.conf
then comment out(#) blacklist rt5370, blacklist rt2x00usb



 New USB device found, idVendor=xxxx
 usb 1-1.2.6: Product: 802.11 n WLAN -> good

lsusb
Bus 001 Device 006: ID 148f:5370 Ralink Technology, Corp. RT 5370 Wireless Adapter

check if the wifi usb dongle is recognized.

 ----------/etc/network/interfaces-----------------
auto lo
 
iface lo inet loopback
iface eth0 inet dhcp

#auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

------------------------------------------------------------------

---------/etc/wpa_supplicant/wpa_supplicant.conf-----------
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
 
network={
        ssid="SSID"
        psk="password"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=TKIP
        group=TKIP WEP104 WEP40
        auth_alg=OPEN
} 

network={
        ssid="SSID"

        key_mgmt=NONE


        auth_alg=OPEN
        wep_key0=1234509876 

} 

 
network={
        ssid="YOURSSID"
        scan_ssid=1
        key_mgmt=WPA-PSK
        proto=WPA
        psk="YOURPASSWORD"
}

--------------------------------------------------------------------------------------

Now enable the modem.
sudo ifup wlan0

On boot connection ------------- /etc/rc.local-------------add--
echo "Starting Wifi.."
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
sleep .5s
dhclient wlan0
echo "Wifi started.."

exit 0
--------------------------------------------------------------------------------------
**file names used exactly, it may vary
Disable power management of usb wifi dongle -- /etc/modprobe.d/*8192cu.conf
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

Ping router every minute on cron
crontab -e ---------------------add
*/1 * * * * ping -c 1 192.168.0.1 #modify this address to router address
--------------------------------------------

------------------to skip rc.local---------- plastikman 20130216---------
auto lo wlan0

iface lo inet loopback
iface eth0 inet dhcp

#auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
-----------------------------------------------------------------------------------------------


Sources: raspberrypi.org/phpBB3/viewtopic.php?f=28&t=47830
http://svay.com/blog/setting-up-a-wifi-connection-on-the-raspberrypi/
above are direct sources (i.e. copy+paste)

http://www.raspberrypi.org/phpBB3/viewtopic.php?t=6256&p=189260
 this is supplementary

Tuesday 12 March 2013

gnuplot 4.4

run gnuplot
plot [0:10] [0:10] (16/x+2), (10-x)
x range y range
average cost function and inverse demand function

Saturday 16 February 2013

Using kismet on ubuntu 12.04

Install

1. download the code kismet-2011-03-R2.tar.gz (http://www.kismetwireless.net/download.shtml)
2. decompress the file to a folder and cd into it *readme.txt
3. configure (./configure)
4. make and make dependencies(make or make dep)
5. install or suidinstall (sudo make install / sudo make suidinstall)

Configure and run

1. sudo gedit /usr/local/etc/kismet.conf (from terminal) or
gksu gedit ~ (from command shortcut Alt-F2)
2. change ncsource if an explicit NIC is available (e.g. wlan1 from usb adapter)
3. change enablesource according to #2 and/or specify logprefix=/home/username/
4. change the adapter mode, first disable, change mode, then enable
sudo ifconfig wlan1 down | sudo iwconfig wlan1 mode monitor | sudo ifconfig wlan1 up
5. sudo kismet or kismet if installed with suidinstall
6. OK to run server
7. press `(~) for accessing menu and tab to change tabs