Posts

Lenovo E450 on Ubuntu Gnome

Some notes running Lenovo E450 on Ubuntu Gnome: 0) Install using UEFI boot Your harddisk will use GPT partition My setting is UEFI boot only, CSM off 1) Wi-Fi disconnect (no problem when using 15.10) sudo apt-get install git build-essential git clone https://github.com/lwfinger/rtlwifi_new.git cd rtlwifi_new make sudo make install http://askubuntu.com/questions/628641/rtl8723be-poor-and-unstable-wireless-in-ubuntu-from-14-04-to-15-04 Create /etc/modprobe.d/rtl8723be.conf options rtl8723be fwlps=0 ips=0 2) Touchpad, when using two finger and moving windows, always jumping to right Go to Settings, Mouse & Touchpad, set Pointer speed to Slow (full left) 3) Grub boot just show grey screen for a few second, then show gnome logo and boot normally Currently no workaround, reported to ubuntu bug 4) Battery charging threshold apt-get install acpi-call-dkms Install tp-acpi-call from https://github.com/teleshoes/tpacpi-bat ./tp-acpi-call -s start 1 40 ./tp-acpi-c...

Create bootable USB flash to boot ISO

Follow these steps to create bootable USB Flash to boot multiple ISO. Using this USB Flash you dont have to bring many installation/recovery DVD. 1. Format USB Flash using FAT32 partition 2. mount it somewhere to /mnt/MOUNTPOINT 3. Install GRUB2 grub-install --target x86_64-efi --efi-directory /mnt/MOUNTPOINT --boot-directory=/mnt/MOUNTPOINT/boot/ --removable 4. Copy ISO files to /mnt/MOUNTPOINT/iso 5. Edit /mnt/MOUNTPOINT/boot/grub/grub.cfg Use this example for start: menuentry 'lenovo diagnostic' {     set isofile='/iso/linux-bootable-cd-4307318.iso'     loopback loop $isofile     linux (loop)/live/vmlinuz boot=live config findiso=$isofile     initrd (loop)/live/initrd.img } menuentry 'systemrescuecd-x86-4.5.4.iso' {     set isofile='/iso/systemrescuecd-x86-4.5.4.iso'     loopback loop $isofile     linux (loop)/isolinux/rescue64 isoloop=$isofile   ...

Atom: my new text editor

Atom version 1.0 has been released. And now atom is my new text editor :) Check it out: https://atom.io/ I'm using these atom packages for PHP development: atom-beautify need to install php-cs-fixer My fixers options: operators_spaces,-multiline_array_trailing_comma,align_equals, align_double_arrow,concat_with_spaces,single_quote,short_tag autoclose-html  (use ctrl-alt-. instead) autocomplete-php linter linter-jshint linter-php highlight-selected minimap minimap-find-and-replace minimap-highlight-selected minimap-linter symbols-tree-view use symbols-list instead unsaved-changes an-color-picker project-plus theme-switcher To get started, try this shortcut: Ctrl-R , Ctrl-T, Ctrl-Alt-. (for html)

Fix NVIDIA gnome-terminal drawing delay

$ nvidia-settings -a InitialPixmapPlacement=0 To make it permanent, add this to ~/.nvidia-settings-rc 0/InitialPixmapPlacement=0

Reuse SSH connection

To reuse existing SSH connection, add this to ~/.ssh/config : ControlMaster auto Host *     ControlPath ~/.ssh/master-%r@%h:%p So you wont be asked for password, when connection to same host, including scp and rsync

DIY: How to fix loose micro usb plug

Image
Required tools: Hit USB plug slowly using hammer and screwdriver. The result is USB plug's plate will be bent slightly

Don't use static field for object when coding Android app

This might save your time:  Don't use static field for object when coding Android app Static methods are OK, create private field or local variable for object and pass it as parameter.

Choosing good USB cable and charge faster

Ever wondering why sometime your phone charges very slow, even using 1A charger. Check the cable! If are using android lollipop, check charging power using Ampere from play store. You can probably see some printed codes on the good quality USB cable, including something like this: "28AWG/2C and 24AWG/2C" or "28AWG/1P + 24AWG/2C". Therefore, charging with a "28AWG/1P + 28AWG/2C" USB cable is normally slower than a "28AWG/1P + 24AWG/2C" cable. Source: http://voyager8.blogspot.com/2013/04/how-to-choose-good-usb-data-and.html?m=1

Email scripts collection (1)

Delete old postmaster email: find /home/vmail/*/postmaster@*/{new,cur} -type f -mtime +30 -delete Delete old trash: find /home/vmail/*/*/.Trash/{new,cur} -type f -mtime +30 -delete Move sent messages to zip: find /home/vmail/*/*/.Sent*/{new,cur} -type f -mtime +30 | zip -m -9 /home/vmail/Sent.zip -@ Move old email to zip: find /home/vmail/domain.com/ -type f -mtime +365 -print | file -F# -if- | grep -E 'rfc822|octet' | awk -F# '{print $1}' | zip -m -9 /home/vmail/Old.zip -@ Update quota2: cd /home/vmail/domain.com du -s * | awk '{ print "insert into quota2 values (\"" $2 "\"," $1 "*1000,1000) on duplicate key update bytes=" $1 "*1000;" }' | mysql -uroot -ppaswot postfixadmin Learn spam from folder Spam: poll mail.domain.com with proto IMAP user 'email@domain.com' there with password 'paswot' folder INBOX.Spam options ssl sslfingerprint 'FB:9D:14:94:FD:F...

Applying patch from remote fork (github)

Find which commit you want to patch, for example: https://github.com/waalt/yowsup/commit/2a56d2c25e53b37221190185c5ffd0eb543bb73f Append ".patch" to URL: https://github.com/waalt/yowsup/commit/2a56d2c25e53b37221190185c5ffd0eb543bb73f.patch Run this to apply: curl https://github.com/waalt/yowsup/commit/2a56d2c25e53b37221190185c5ffd0eb543bb73f.patch | git apply Reference: http://transparatech.com/blog/how-use-git-apply-patch-directly-remote-server-without-downloading-it-first-0

Make firefox faster

After using Mozilla Firefox for a long time, it become slow. Try Clear Cache , and set Cache limit to 50 MB