Posts

Showing posts with the label Linux

Remove unwanted entry in UEFI BIOS boot menu

If your original OS is installed in UEFI mode, the installation of some other OS (e.g Ubuntu) in UEFI mode later on introduces some artifacts to the EFI partition the hard drive, and due to them, in the UEFI BIOS boot menu you see the respective boot menu entry. To remove the entry completely, you need to remove the artifacts to the EFI partition, and then move the respective boot entry. Delete EFI/distro of the EFI partition Linux Locate your EFI partition with sudo fdisk -l and find out the partition with EFI Partition under the Type column. Suppose the EFI partition is /dev/sda2 , do the following to mount it on an empty folder. mkdir /mnt/efipart mount /dev/sda2 /mnt/efipart Next find the directory corresponding to the OS that you have installed. It is mostly under EFI/ distro_name Remove that directory and its contents by sudo rm -r EFI/distro_name . Windows Start cmd.exe as administrator. Run diskpart in it. Microsoft Windows [Version 10.0.14393] (c) 20...

Network issue resources

ntpdate[24246]: no server suitable for synchronization found http://askubuntu.com/questions/429306/ntpdate-no-server-suitable-for-synchronization-found http://serverfault.com/questions/277375/ntpdate-d-server-dropped-strata-too-high Juniper specific issues With Juniper: https://kb.juniper.net/InfoCenter/index?page=content&id=KB15756&actp=search Set date/time in Juniper: http://www.juniper.net/documentation/en_US/junos/topics/task/operational/junos-time-date-setting.html NTP setup in Juniper: http://www.juniper.net/documentation/en_US/junos/topics/task/configuration/network-time-protocol-configuring.html NTP debugging with Juniper: https://kb.juniper.net/InfoCenter/index?page=content&id=KB15756&actp=search Juniper LAG creation error: xSTP configuration disallowed on interface http://www.juniperforum.com/index.php?topic=27731.0

iptables pocket reference

iptables -L lists all rules  iptables -S [chain] shows the commands that build the rules of the chain. iptables -D [rule index or rule details] deletes a particular chain. NAT iptables -L -t nat lists all NAT rules. Replace source private IP to a public one, then when reply comes back, replace the associated destination public IP back to the private one. iptables -t nat -A POSTROUTING -s 192.168.128.4 -j SNAT --to-source 10.247.65.43 iptables -t nat -A PREROUTNG -d 10.247.65.43/32 -j DNAT --to-destination 192.168.128.4 Replacing rules iptables -R INPUT 1 -p tcp -s 192.168.0.0/24 --dport 80 -j ACCEPT Save modified iptables service iptables save Reference Reference 2

Getting Wiimote to work on Ubuntu 14.10

Install xwiimote and blueman. Use blueman (Bluetooth Manager) to ad the wiimote. When add, choose add without pairing. Connect the wiimote using blueman or the applet integrated on the desktop toolbar. Dolphin can then find it.

Octoshape under environment with network proxy

In an environment with network proxy, you have to manually specify the global http and https proxy setting of the system for octoshape to work properly. In Ubuntu, you can find it in All Settings -> Network. Under proxy, manually set the HTTP and HTTPS proxy and click on "Apply system wide".

A good way to list all file names (probably with whitespace) in bash

Typical find . bash command interprets a file with whitespace in name into multiple files. To avoid this problem, use the following construct,   find . - iname "foo*" | while read f do echo ${f} done   Reference     To eliminate leading ./ in the listed file names, change the code above to the following. find . - iname "foo*" | while read f do echo ${f#./} done Reference

rpi dvd to iso in linux

Check where the CD is located in the Linux system > cdrdao scanbus Suppose you get the following which says it is at /dev/sr0 Cdrdao version 1.2.3 - (C) Andreas Mueller /dev/sr0 : Slimtype, DVDRW SOSW-833S , VRS3 Make sure that location is unmounted. > umount /dev/sr0 Do the following command to rip the dvd to iso. > cat /dev/sr0 > /home/tylau0/disc.iso   

Activate copies of Office 2010 which utilizes cscript on PlayOnLinux

Click on "Config" in the PlayOnLinux main screen. Then select the Wine tab on the right window, and select "Registry Editor". Under [HKEY_LOCAL_MACHINE\Software\Microsoft\OfficeSoftwareProtectionPlatform] Insert: "KeyManagementServiceName REG_SZ " [[Licence server]] "KeyManagementServicePort REG_SZ " [[ Port of the licence server]] Start MS Office (i.e. Word). Then the following entry will be automatically created: [HKEY_USERS\S-1-5-20\Software\Microsoft\OfficeSoftwareProtectionPlatform] Insert: "VLRenewalSchedule REG_BINARY " [[Any value]] Close MS Office completely and restart it. Reference

Program to allow old computer to boot with USB driver

Plop

Useful Linux applications

WinFF - play .trp media files   AcetoneISO - dump CD/DVD Hugin - stitch photos

Problem running OpenGL program in a virtual machine

In case you encounter the following issue when running OpenGL program in a virtual machine OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x180fb10 OpenGL Warning: Retry with 0x8002 returned 0 visuals Segmentation fault (core dumped) You may set the LIBGL_ALWAYS_INDIRECT environment variable to 1 before running my GLUT programs, as follows. export LIBGL_ALWAYS_INDIRECT=1 Reference

cannot start eclipse in Ubuntu 12.04 -- java.lang.UnsatisfiedLinkError: Could not load SWT library.

The needed stuff are under /usr/lib/jni/ folder. One needs to symlink them in and it worked. ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/ Reference

Run 32-bit executables on 64-bit Linux

Look for the package/library called ia32.

Play DOS PC Games with CD audio through images

Check where the CD is located in the Linux system > cdrdao scanbus Suppose you get the following which says it is at /dev/sr0 Cdrdao version 1.2.3 - (C) Andreas Mueller /dev/sr0 : Slimtype, DVDRW SOSW-833S , VRS3 Make sure that location is unmounted. > umount /dev/sr0 Create the bin image of the CD and the corresponding cue file via > cdrdao read-cd --datafile image.bin --driver generic-mmc:0x20000 --device /dev/sr0 --read-raw image.toc > toc2cue image.toc image.cue Install DosBox Start DosBox Mount the c drive to some directory in the local machine, for example > mount c /home/tylau/Documents/dos Mount the d drive to the cue file, for example > imgmount d /home/tylau/Desktop/ssf2t.cue -t iso -fs iso Follow instruction to install or start the game. Command to burn the bin/cue back to a CD. cdrdao write --device /dev/sr0 --swap ssf2t.toc   To convert bin/cue to iso/wav bchunk IMAGE.bin IMAGE.cue IMAGE.iso  -w Ref Ref2