Posts

Showing posts with the label linux tips

Enabling fingerprint auth in Fedora 25

By default only login is using fingerprint auth but not for sudo, to enable: Just run authconfig-tui and check Use fingerprint reader Then enroll your fingerprint using Settings - Users To enroll multiple fingerprint matches, do this from terminal: fprintd-enroll -f FINGERNAME Replace FINGERNAME with: right-little-finger, right-middle-finger, right-thumb, right-index-finger, right-ring-finger You can swipe same finger for all enroll

Transfer files MTP using ubuntu (honeycomb android)

Tablet using honeycomb such as Samsung Galaxy Tab, Motorola Xoom Using aafm (beta) https://github.com/sole/aafm Rule for udev: SUBSYSTEMS=="usb", ATTRS{idVendor}=="04e8", ATTRS{idProduct} =="685e", MODE="0666", OWNER="khad" # service udev restart forum: http://forum.xda-developers.com/showthread.php?t=1077377 Using ddms: http://forum.xda-developers.com/showpost.php?p=16623845&postcount=27

Run 64bit Guest on 32bit Host Virtualbox

Virtualbox is really cool software for virtualization and it is free. Latest version of virtualbox support running 64bit guest, even on 32bit host. See this checklist: Make sure your processor support VT-x (or AMD-v) and 64bit Enable in BIOS: Virtual Machine Technology set option in guest: PAE, IOAPIC, ACPI to enabled And most important thing: set OSType to Ubuntu_64 or Windows_64 (note the _64) Install your guest OS (i prefer using headless and rdp)

Using zram (was compcache)

I've tried compcache but dont get good result: http://superbiji.blogspot.com/2010/12/enable-compcache-in-ubuntu.html But zram seem working fine. Compcache will be included in 2.6.37 kernel, named: zram. But if you want to try it follow this step: Download and install 2.6.36 kernel from here: http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.36.2-natty/ Get compcache source (not tar.gz), if you get compile error see reference below: hg clone https://compcache.googlecode.com/hg/ compcache make cp zram.ko /lib/modules/2.6.36-02063602-generic/updates/ depmod -a Add this to /etc/rc.local: # if you have 2 core modprobe zram num_devices=2 # 500mb each, usually compressed to 80% echo 524288000 > /sys/block/zram0/disksize echo 524288000 > /sys/block/zram1/disksize mkswap /dev/zram0 mkswap /dev/zram1 swapon /dev/zram0 -p 100 swapon /dev/zram1 -p 100 Next, reboot and run big apps like eclipse, 3 virtual machines Reference: http://www.vflare.org/2010/05/compresse...

Enable compcache in ubuntu

Sometimes I'm running a lot of VM? which needs a lot of memory, so i try to enable compcache: vim /etc/initramfs-tools/initramfs.conf #Edit this line: COMPCACHE_SIZE="60 %" update-initramfs -u reboot After enabled, you can see new swap device (ramzswap): cat /proc/swaps Filename Type Size Used Priority /dev/ramzswap0 partition 1229208 0 100 /dev/sda3 partition 2064344 0 -1 http://code.google.com/p/compcache/

How to mirror wiki for offline reading

Change: wiki.zimbra.com to preferred site

wake on lan

Sometimes i need to wake up my desktop when i work from other place. To access cvs or encode some file. It is turned off automatic every 9pm. Ive setup openvpn connection to gateway. First find out your desktop hardware address: ifconfig Note eth0 broadcast address and save hardware address to a file on gateway edit rc.local or boot.local on desktop, add: ethtool -s eth0 wol g And run it from command line, then shutdown -h now On gateway type this to wake it up, takes several minutes before we can ping wakeonlan -i 192.168.1.255 -f desktop -p 7 Or wakeonlan -i BROADCASTADDR HARDWAREADDR -p 7 Output: Sending magic packet to 192.168.1.255:9 with 00:50:8D:86:XX:XX http://ubuntuforums.org/showthread.php?t=234588

Ubuntu 10.04 dont serve PHP script problem

After upgrading to Ubuntu 10.04 all my php script not working. this is because new stupid feature new configuration in apache2 which disable php in user directories. To fix: vim /etc/apache2/mods-available/php5.conf Remark all user dir related config, change to: <IfModule mod_php5.c> <FilesMatch "\.ph(p3?|tml)$"> SetHandler application/x-httpd-php </FilesMatch> <FilesMatch "\.phps$"> SetHandler application/x-httpd-php-source </FilesMatch> # To re-enable php in user directories comment the following lines # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it # prevents .htaccess files from disabling it. #<IfModule mod_userdir.c> # <Directory /home/*/public_html> # php_admin_value engine Off # </Directory> #</IfModule> </IfModule> Then restart apache. You may need to clear firefox cache. _

Format sdcard option (updated)

Sometimes when copying lots of files to sdcard causes corrupt in portable device. To avoid this we can increase cluster size when formatting. This will also increase read/write performance on sdcard. Under linux we can use: mkfs.vfat -h0 -n MYSDCARD -S 4096 -v /dev/sdc1 UPDATE: using command above seems dont compatible on Windows, you can use this application: http://www.ridgecrop.demon.co.uk/index.htm?fat32format.htm or use this compatible command: mkfs.vfat -s 32 -S 512 -n "USB DISK" /dev/sdc1 mkfs.vfat -s 64 -S 512 -n "USB DISK" /dev/sdc1 mkfs.vfat -s 128 -S 512 -n "USB DISK" /dev/sdc1

Remove mail queue (spam) quickly

Find out size of spam emails: # /opt/zimbra/postfix/sbin/postqueue -p | head -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- E13B82CF2D27* 3874 Tue Apr 27 11:06:01 peter@springresort.com.tw (delivery temporarily suspended: connect to genie.com[169.132.165.132]: Connecti on timed out) cle2322518@genie.com (delivery temporarily suspended: connect to genie.net[169.132.165.132]: Connecti on timed out) We get 3874 Now, remove the spam: # /opt/zimbra/postfix/sbin/postqueue -p | grep 3874 | awk -F '\*|\!| ' '{ print $1 }' | /opt/zimbra/postfix/sbin/postsuper -d - postsuper: EEE0E6EE02D9: removed postsuper: 4553C6EE0013: removed postsuper: 6AB126EE035D: removed postsuper: Deleted: 102837 messages