Friday, October 02, 2015

[Off] Windows 10: How to Prevent Windows 10 From Automatically Downloading Updates


- Windows 10 PCs automatically check for updates and install any updates they find.
- Windows won’t download updates on connections you mark as "metered".
- To set a connection as "metered": Settings app --> Network & Internet --> Wi-Fi network list --> Advanced options --> Activate the “Set as metered connection” option.

From: http://www.howtogeek.com/224471/how-to-prevent-windows-10-from-automatically-downloading-updates

Sunday, September 06, 2015

Upgrade Debian: libbz2.so.1.0: cannot open shared object file

From wheeze (old stable) to stretch (current testing)
Error 1: libbz2.so.1.0: cannot open shared object file
Solution:
# ln -s /lib/i386-linux-gnu/libbz2.so.1.0 /lib/libbz2.so.1.0
# apt-key update

Error 2:
dpkg: error processing /var/cache/apt/archives/mime-support_3.54_all.deb (--unpack): triggers ci file contains unknown directive `interest-noawait'
Explanation: To use mime-support from version 3.54 onwards, dpkg from version 16.1 onwards, which supports the trigger directive ‘interest-noawait’, is needed.
Solution:
# apt-get install dpkg

Error 3:
initscripts : Breaks: nfs-common (< 1:1.2.5-3) but 1:1.2.2-4squeeze2 is to be installed
Solution:
# apt-get install nfs-common


Error 4: Could not perform immediate configuration on 'default-jre'.
Solution:
# apt-get remove default-jre-headless

Other errors: apt-get -f dist-upgrade

Friday, January 11, 2013

Debian wheezy (testing) on VAIO VPCSB11FX

Wireless driver (ref: http://wiki.debian.org/iwlwifi)
  • # apt-get install firmware-iwlwifi [need to have non-free in sources.list)
  • # modprobe -r iwlagn ; modprobe iwlagn
Enable touchpad scrolling
  • Run
    # rmmod psmouse
    # modprobe psmouse proto=imps
  • Make permanent: # nano /etc/modprobe.d/options, add
    options psmouse proto=imps
  • Note: proto = bare (Bare PS/2), imps (Microsoft Intellimouse), exps (Microsoft Explorer Mouse), ps2pp (Logitech Mouse), genps (Genius Wheel Mouse), targus (Targus Scroller Mouse), synaptics (Synaptics TouchPad), any, auto. (Someone says "Using exps instead of imps has advantages when you like to use your thumb buttons.")
lm-sensors
  • # apt-get install lm-sensors
  • # sensors-detect --> add coretemp into /etc/modules
  • # sensors
ATI propriety driver (http://wiki.debian.org/ATIProprietary) [to make it less hot]
  • # apt-get install linux-headers-3.2.0-4-amd64 fglrx-control fglrx-drive [notice the version of kernel headers]
  • Quit X
  • # modprobe -r radeon drm
  • # aticonfig --initial
  • /etc/X11/xorg.conf has something like:
    Section "Device"
        Identifier  "ATI"
        Driver      "fglrx"
    EndSection
    
    Section "Screen"
        Identifier "Default Screen"
        DefaultDepth     24
    EndSection
  • # startx
CPU frequency scaling (http://wiki.debian.org/HowTo/CpuFrequencyScaling) [to make it less hot]
  • # apt-get install cpufrequtils
  • # cpufreq-info --> information
  • # nano /etc/default/cpufrequtils; add
    # valid values: userspace conservative powersave ondemand performance
    # get them from cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_gove$
    GOVERNOR="conservative"
    
  • cpufrequtils has an init script that should load the appropriate driver at boot time. # ls /lib/modules/$(uname -r)/kernel/drivers/cpufreq/ lists available drivers (modules), such as powernow_k6 (for AMD K6), powernow_k7 (AMD K7: Athlon, Duron, Sempron 32 bits), powernow_k8 (AMD K8: Athlon 64, Turion 64, Sempron 64, Opteron 64), p4_clockmod (Pentium 4, Celeron D, Pentium D, Celeron M), speedstep_centrino (Pentium M, Core Duo, Core 2 Duo), acpi_cpufreq (generic driver).
  • # apt-get install sysfsutils
  • # nano /etc/sysfs.conf, edit like
    devices/system/cpu/cpu0/cpufreq/scaling_governor = conservative
  • read more: http://technowizah.com/2007/01/debian-how-to-cpu-frequency-management.html, http://ubuntuforums.org/showthread.php?t=248867
Others
  • Change the brightness of screen: # echo -n 8 > /sys/class/backlight/acpi_video0/brightness
  • Ubuntu forum: http://ubuntuforums.org/showthread.php?t=1731232

Sunday, June 03, 2012

Install Android in VirtualBox with Internet connection

  1. Download a "Buildroid for VirtualBox" OVA file at http://www.buildroid.org. There are 3 versions: for "phone", for "tablet" and for "tablet" with phone capabilities. [There is a Buildroid image with Market/Play app but "for testing purpose only".]
  2. Import the Buildroid image into Virtualbox: File --> Import Appliance...
  3. Install Google Play Store app (and other apps) (in Windows):
    • Get the adb (Android Debug Bridge) utility from Android SDK (http://developer.android.com/sdk/index.html) or download the adb at https://sites.google.com/site/keyablefile/adb-win.zip (including adb.exe and AdbWinApi.dll).
    • Download the app at http://buildroid.org/Download/buildroid-gapps-ics-20120317-signed.tgz
    • VirtualBox: Settings --> Network --> Adapter 1 --> Attached to: NAT; Advanced --> Port Forwarding --> Insert new rule: both Host Port and Guest Port = 5555. [Multiple virtual machines: increment the host port (5556,...) and keep the same guest port for each machine.] [Adapter 2 is used for emulating a Wifi connection.]
    • Start Buildroid virtual machine. Open Buildroid VM Configuration, there should be the IP address under IP Management.
    • In Windows Explorer, go to the folder containing adb.exe; Shift-right click --> Open command window here. [Check adb help for options and parameters.]
      • adb connect localhost (or adb connect the_above_IP_address)
      • adb push path\to/buildroid-gapps-ics-20120317-signed.tgz /sdcard/ (copy the .tgz apps file to Android)
      • adb shell
      • su
      • mount -o remount,rw /system
      • tar -xvzf /sdcard/buildroid-gapps-ics-20120317-signed.tgz
      • mount -o remount,ro /system
      • reboot
    • The Adroid machine will reboot and there should be Google apps including Market/Play.
Ref:
- http://keyable.blogspot.jp/2012/05/how-to-run-android-40-in-virtualbox.html
- http://www.buildroid.org/blog/?page_id=121

Install Android in VirtualBox

  • Dowwnload android-x86-4.0-RC1-eeepc.iso or android-x86-4.0-RC1-asus_laptop.iso from http://www.android-x86.org/download.
  • Create a new virtual machine on VirtualBox. OS type: Linux, version Linux 2.6. Memory: 512 MB or 1000 MB. Create a new boot harddisk. Adjust the settings: Sound: Sound Blaster 16; Network: NAT (or Bridged), adapter: PC-net-FAST III
  • Install Android. Choose Install Android-x86 to harddisk from the boot menu. Create one partition for the full harddisk, formatted as ext3. Install the boot loader GRUB. When the installation finishes, select "Run Android x86" to boot the Andoid. (Before the next booting, remove the CD image from Settings-Storage-IDE Controller.)
  • To make the mouse work in the virtual machine, go to “Machine” in the menu and select “Disable mouse integration” (right Ctrl, by default, to restore the mouse in host machine). Alt-1 and Alt-7 to enter command line or go back to graphical interface. Shutdown the machine by command-line (halt) or from menu of VirtualBox. Press Esc to exit standby mode.
  • To connect the Internet (from command line, tested with NAT):
    • netcfg to list the devices.
    • dhcpd eth0
    • setprop net.dns1 8.8.8.8
Ref:
- http://maketecheasier.com/install-android-4-0-ice-cream-sandwich-in-virtualbox/2012/03/02
- http://groups.google.com/group/android-x86/browse_thread/thread/eb88bb948176f6b8
- http://groups.google.com/group/android-x86/browse_thread/thread/ec0aee3a027775d7

Note:
  • By the above method, the Internet can be accessed using browser, but other apps cannot access the Internet (they need "wifi").
  • To access the Internet with other apps: see http://keyable.blogspot.jp/2012/05/how-to-run-android-40-in-virtualbox.html

Thursday, May 03, 2012

Read Vietnamese on Sony Reader PRS-T1

Fully embed fonts:
  1. Add the ePub book into Calibre. Right click on the book, choose Tweak Book. Choose Explode ePub.
  2. The file browser (Windows Explorer) will open at an temporary address like C:\Users\UserName\AppData\Local\Temp\calibre_0.8.44_tmp_2s_358\qsvcc__exploded. There should be files stylesheet.css and content.opf.
  3. In the directory containing the .css file, make a new directory named fonts. Copy 4 Gentium Book Basic fonts to that directory (the fonts can be download at scripts.sil.org/Gentium_basic).
  4. Open the .css file in a text editor and add 4 @font-face statements. (Notice the url at src:.) (There may be other .calibre, .calibre1,... in the file.)
    @font-face {
        font-family: serif;
        font-weight: normal;
        font-style: normal;
        src: url(fonts/GenBkBasR.ttf)
        }
    @font-face {
        font-family: serif;
        font-weight: normal;
        font-style: italic;
        src: url(fonts/GenBkBasI.ttf)
        }
    @font-face {
        font-family: serif;
        font-weight: bold;
        font-style: normal;
        src: url(fonts/GenBkBasB.ttf)
        }
    @font-face {
        font-family: serif;
        font-weight: bold;
        font-style: italic;
        src: url(fonts/GenBkBasBI.ttf)
        }
    
    Anywhere in the .css file where there is
    font-family: "Gentium Book", serif;
    can either be replaced with
    font-family: serif;
    or removed altogether because serif is the default font used by the reader.
  5. Edit the .opf file, manually add the 4 font files to the section. (In theory, this step is to make a compliant epub. In practice, it may make no difference to whether the epub will read correctly on PRS-T1.)
    <manifest>
        ... lots of file paths ...
        <item href="fonts/GenBkBasR.ttf" id="serifr" media-type="application/x-truetype-font"/>
        <item href="fonts/GenBkBasI.ttf" id="serifi" media-type="application/x-truetype-font"/>
        <item href="fonts/GenBkBasB.ttf" id="serifb" media-type="application/x-truetype-font"/>
        <item href="fonts/GenBkBasBI.ttf" id="serifbi" media-type="application/x-truetype-font"/>
    </manifest>
    
    The href attribute needs to be the path of the .ttf file relative to the .opf file inside the epub.
  6. Save and close all the edited files. Run Rebuild ePub in the window from Calibre.
Note:
  1. It is not a good idea to do a Calibre conversion on an epub after it has fonts fully embedded. Sometimes the fonts no longer work afterwards.
  2. The fonts may not work on the reader when fully embedded to an epub which has previously been added @font-face statements during a Calibre conversion using the ExtraCSS box. The conversion process will have placed all the @font-faces in each and every (x)html file inside the epub rather than in the .css file. These may well override the ones just manually added to the .css file. If this is the problem, manually removing the @font-faces from the html files should correct it.
More to read: 3 ways to achieve epubs with customized fonts
  1. Embedding. Font files are copied into the epub, @font-face css is added to the epub's existing css file.
    Often used by publishers for DRM'd retail epubs; but can be done for epubs not locked by DRM.
    Pros
    - epub should work on any reader which uses the Adobe renderer.
    Cons
    - non-DRM epubs only
    - The font files would be contained in every single epub. Some are quite large and add up to a lot of disk space if thousands of books are kept on the reader.
    - Have to manually edit each epub to embed font files, extra @font-face css and make some changes to the epub's .opf file.
  2. Font files are copied to the reader, @font-face css is placed in a specially-named .css file on the reader.
    This requires the firmware on the reader to be slightly modified to recognise the .css filename containing the @font-faces. This is because Adobe has seen fit to hide its default css file deep inside the firmware where users can't get at it.
    Pros
    - Can be used for all epubs whether they have DRM or not.
    - Only need to copy the font files and @font-face css to the reader once.
    - Don't need to do anything special in Calibre, nor to edit each epub.
    Cons
    - Have to 'hack' the reader firmware.
  3. A kind of hybrid. Font files are copied to the reader, @font-face css added to each epub's css file.
    The @font-face css can be added into each epub's css file manually using Calibre's Tweak-epub feature. Or this can also be done by a Calibre conversion to epub, by copying the @font-face css into Calibre's Convert - Look&Feel - ExtraCSS box.
    Pros
    - no hacking required
    - Only need to copy the font files to the reader once.
    - If the @font-face css is added to Calibre Preferences, this process is only needed to be done once. Cons
    - non-DRM epubs only
    - Because the @font-face css is slightly different for each brand of reader, the same epub cannot be used on different readers, e.g. an epub prepared for a Sony will not display correctly on a PocketBook, and vice versa.
Acknowledgments: jackie_w from mobileread.com
  • http://www.mobileread.com/forums/showpost.php?p=1818037&postcount=11
  • http://www.mobileread.com/forums/showpost.php?p=1726853&postcount=190

Monday, April 30, 2012

Using Epson Scanner 7600U (Windows 7)

On Epson's page (http://www.epson.jp/dl_soft/list/1221.htm), no driver for Windows 7. Thanks to http://d.hatena.ne.jp/miya_kaz/20120110/1326180360, it is found that the scanner can be used by the GT-9300's driver.

http://www.epson.jp/dl_soft/list/1502.htm#43

ここでWin7 64bit用のEPSON Scanをダウンロード,実行

使用する機器を聞かれるので,GT-9300を選択,インストール

スキャナをPCに接続する。最初のドライバ探しは失敗する。

デバイスマネージャでプロパティ→ハードウェア→プロパティ→設定の変更クリック。

ドライバータブ→ドライバの更新→コンピュータを参照→デバイスドライバの一覧から選択→イメージングデバイス→EPSON→GT-9300 を選択,インストール

ここまでやったらEPSON Scanを実行。Scanできました。

Saturday, November 05, 2011

Remove accent marks from filename in Vietnamese

(Gỡ bỏ dấu tiếng Việt trong tên tập tin)

This is a java code from http://khoinguonit.com/f80/[java]-doi-ten-file-tieng-viet-co-dau-thanh-khong-dau-1578/

  • It reads files from the input folder and then moves them to output. To make changes to files in the current directory, use . (dot) instead.
  • Online complier at http://www.innovation.ch/java/java_compile.html.
  • From console, run it by java Rename, or make a run.bat:
    @echo off
    java Rename

    pause
  • This code also changes upper cases into lower cases.