Thursday, December 27, 2018

Realtek RTL8111/8168/8411 slow transfer speed

scp works like this normally:
[penguin@alpha ~]$ scp linuxmint-19.1-mate-64bit.iso m715q3:/home/penguin/
penguin@m715q3's password:
linuxmint-19.1-mate-64bit.iso                                     100% 1936MB 110.8MB/s   00:17   
 

scp works something like this unexpectedly:
[penguin@alpha ~]$ scp linuxmint-19.1-mate-64bit.iso m715q3:/home/penguin/
linuxmint-19.1-mate-64bit.iso                                       0% 2832KB 390.4KB/s 1:24:30 ETA^


Fix:
Reboot the PC and go into the BIOS Setup
Disable the onboard Ethernet controller
Save and Exit from the BIOS Setup, during POST, turn off the PC
Power on the PC and enable the onboard Ethernet controller
Save and Exit from the BIOS, boot the OS

Rebuild OS does not fix this issue, for some reasons the Realtek onboard Ethernet has this issue occassionally, it happens on two of our Lenovo ThinkCenter M715Q Tiny.

Sunday, August 6, 2017

RHEL7.2 totem

Probably one of the easiest way to enable playback of .ts|.iso with totem player on RHEL 7.2

Install the following rpm from the fedoraproject.org:
# rpm -Uvh http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm 


Download and install the following rpm from rpmfusion.org:
rpmfusion-free-release-7.noarch.rpm
rpmfusion-nonfree-release-7.noarch.rpm

# rpm -ivh rpmfusion-free-release-7.noarch.rpm
# rpm -ivh rpmfusion-nonfree-release-7.noarch.rpm

Yum install banshee, this is the one that does the magic!
# yum install banshee

My box has the following packages logged in /var/log/yum.log:
Aug 05 20:32:00 Installed: media-player-info-17-4.el7.noarch
Aug 05 20:32:01 Installed: webkitgtk-2.4.9-1.el7.x86_64
Aug 05 20:32:01 Installed: libgpod-0.8.3-14.el7.x86_64
Aug 05 20:32:01 Installed: libgdiplus-2.10-9.el7.x86_64
Aug 05 20:32:02 Installed: mono-winforms-4.2.4-7.el7.x86_64
Aug 05 20:32:02 Installed: mono-extras-4.2.4-7.el7.x86_64
Aug 05 20:32:02 Installed: mono-data-4.2.4-7.el7.x86_64
Aug 05 20:32:03 Installed: mono-wcf-4.2.4-7.el7.x86_64
Aug 05 20:32:03 Installed: mono-mvc-4.2.4-7.el7.x86_64
Aug 05 20:32:03 Installed: mono-web-4.2.4-7.el7.x86_64
Aug 05 20:32:05 Installed: mono-core-4.2.4-7.el7.x86_64
Aug 05 20:32:05 Installed: mono-data-sqlite-4.2.4-7.el7.x86_64
Aug 05 20:32:05 Installed: gtk-sharp2-2.12.26-3.el7.x86_64
Aug 05 20:32:05 Installed: 1:dbus-sharp-0.7.0-15.el7.x86_64
Aug 05 20:32:05 Installed: dbus-sharp-glib-0.5.0-13.el7.x86_64
Aug 05 20:32:05 Installed: notify-sharp-0.4.0-0.26.20100411svn.el7.x86_64
Aug 05 20:32:05 Installed: gudev-sharp-0.1-18.el7.x86_64
Aug 05 20:32:05 Installed: gkeyfile-sharp-0.1-19.el7.x86_64
Aug 05 20:32:05 Installed: gnome-sharp-2.24.2-12.el7.x86_64
Aug 05 20:32:06 Installed: gio-sharp-0.3-14.el7.x86_64
Aug 05 20:32:06 Installed: mono-addins-1.1-3.el7.x86_64
Aug 05 20:32:06 Installed: taglib-sharp-2.1.0.0-3.el7.x86_64
Aug 05 20:32:06 Installed: gdata-sharp-1.4.0.2-18.el7.x86_64
Aug 05 20:32:06 Installed: mono-zeroconf-0.9.0-16.el7.x86_64
Aug 05 20:32:06 Installed: libgpod-sharp-0.8.3-14.el7.x86_64
Aug 05 20:32:07 Installed: banshee-2.6.2-11.el7.x86_64
Aug 05 20:32:07 Installed: gtk-sharp-beans-2.14.0-17.el7.x86_64

 

Now try to play .ts or .iso (mount it first) file under totem, it asks to download some other components.
According to the /var/log/yum.log...
Aug 05 20:46:37 Installed: lame-libs-3.99.5-8.el7.x86_64
Aug 05 20:46:37 Installed: libmad-0.15.1b-20.el7.x86_64
Aug 05 20:46:37 Installed: liba52-0.7.4-27.el7.x86_64
Aug 05 20:46:37 Installed: twolame-libs-0.3.13-5.el7.x86_64
Aug 05 20:46:37 Installed: opencore-amr-0.1.3-3.el7.x86_64
Aug 05 20:46:37 Installed: x264-libs-0.148-11.20160614gita5e06b9.el7.x86_64
Aug 05 20:46:37 Installed: libmpeg2-0.5.1-10.el7.x86_64
Aug 05 20:46:37 Installed: gstreamer1-plugins-ugly-1.4.5-1.el7.x86_64
Aug 05 20:46:38 Installed: gstreamer1-libav-1.2.4-4.el7.x86_64


The box is now capable of playing media files with RHEL 7!

Saturday, June 7, 2014

Cinnamon Wallpaper Shell Script

A little shell script to change wallpaper in Cinnamon

Copy the following script and modify it accordingly:
#!/bin/sh
# Script variables
DIR="/home/linuxmint/Pictures"               # Directory contains wallpaper

WALLPAPER=$(ls $DIR/*.png | shuf -n1)    # File extension is set to *.png
echo $WALLPAPER                          # Debug
gsettings set org.cinnamon.desktop.background picture-uri "file:$WALLPAPER"
 


Save the script as wallpaper.sh, and set the file permission to 755.
Then you can run it from your terminal and start debugging.
Once you are happy with it, add it to your crontab (including DISPLAY=:0)
The one below runs every 5 minutes:
*/5 * * * * DISPLAY=:0 /home/linuxmint/script/wallpaper.sh

To debug, you can run the following commands directly:
gsettings set org.cinnamon.desktop.background picture-uri "file:/home/linuxmint/Pictures/snsd01.png"
gsettings get org.cinnamon.desktop.background picture-uri
  
That's it!

Saturday, April 12, 2014

CrunchBang 11 "Waldorf" on VAIO P - VPCP115KG


An Aging Laptop
Released in June 2010 with an ATOM CPU Z540, VAIO P shows its age with Mate / Cinnamon desktop. At some point I planned to sell it out but after the announcement that Sony sold its VAIO division, I preferred to keep it and started looking for a lightweight, non Xfce Linux distro. Came across an article from LXF and then did a bit googling, I decided to give CrunchBang a try as it looks very promising with a simple desktop and a dark theme, a bit look like the old days of Linux Mint 5.

Installation
Download the 32-bit Waldorf for Modern PCs torrent and transfer the iso to a USB flash drive using USB image writer. The installation is straight forward and VAIO P displays everything correctly. The only problem I got was the LVM partitioning and poked around the menu for quite a while. In general the installation should finish everything in 10 minutes. Once CrunchBang starts, an interactive shell prompts and guides you through updates and packages installation.

Problem: Screen Flickers
The screen keeps flickering and the following errors are logged in /var/log/messages:
Apr 10 10:31:25 vpcp115kg kernel: [  187.040067] [drm] GMBUS timed out, falling back to bit banging on pin 0 [gma500 gmbus disabled]

The fix is to install latest kernel using smxi, the kernel I am using is:
root@vpcp115kg:~# uname -a
Linux vpcp115kg 3.12-10.dmz.1-liquorix-686 #1 ZEN SMP PREEMPT Fri Feb 7 04:09:24 UTC 2014 i686 GNU/Linux

 

Problem: Audio playing too fast
When playing flac using VLC player or Audacious, the audio playing is too fast. This problem emerges from the liquorix kernels. With the default kernel Linux 3.2.0-4-686-pae the playback of audio is fine.

The fix is to append the following line to /etc/modprobe.d/alsa-base.conf
options snd-hda-intel position_fix=1

Reboot and then run the following commands:
rm -rf ~/.pulse*
pulseaudio -k

< 30 seconds
From power up to Openbox login prompt it takes about 27.4 seconds from my stopwatch!

Thursday, July 19, 2012

SO-02D Upgraded to ICS

Background

I bought this phone and a SIM cutter from Amazon Japan in April. In order to use EMOBILE SIM I had it unlocked at local NTT Docomo shop. It was a very unpleasant experience as the staff took more than 10 minutes to check my identity... longer than the time to unlock the phone.

Since most of the bundled Docomo's apps do not run without Docomo's SIM card, and the most important function data-tethering is de-activated for the same reason. This SO-02D was flashed using FlashTool with Generic UK (1257-3921) LT26i ROM (6.0.A.3.67). I was so regret that I should flash it right after the phone was unlocked instead of waiting for 2 more weeks.


Upgrade to ICS

Follow this thread from xda and your SO-02D should have no issue to upgrade to ICS. The only difference from the instruction is my phone gets charge whenever it is connected to my laptop throughout the flash process.

Once upgrade completed, enter the following EMOBILE APNs:

EMnet
APN名 emnet.connect
ユーザー名 emobile
パスワード emobile
プロキシ wm.internal.emnet.ne.jp
ポート 8080
MMSC http://mms.internal.emnet.ne.jp
MMSプロキシ proxy.internal.emnet.ne.jp
MMSポート 8080
 

My EMOBILE
APN名 myemobile
ユーザー名 em
パスワード em
MCC 440
MNC 00
認証タイプ PAP
APNタイプ default,supl,mms
 

PROTOCOL制限ありB
APN名 emb2.ne.jp
ユーザー名 em
パスワード em
MCC 440
MNC 00
認証タイプ PAP
APNタイプ default,supl,mms
 

PROTOCOL制限なし
APN名 emb.ne.jp
ユーザー名 em
パスワード em
MCC 440
MNC 00
認証タイプ PAP
APMタイプ default,supl,mms
 

PROTOCOL制限なしN
APN名 emb3.ne.jp
ユーザー名 em
パスワード em
MCC 440
MNC 00
認証タイプ PAP
APMタイプ default,supl,mms



If it is too bothersome, just input the settings of EMnet and PROTOCOL制限なしN. I opt the latter as the default setting. The phone should now be able to connect to internet.


I installed EMnetメール and emobileメール to retrieve EMOBILE's email. emobileメール works without any issue. EMnetメール does not work without switching the APN to EMnet, which is a minor issue as I only receive one email monthly from EMOBILE (i.e. billing!).


Clean Up

With root privilege, I removed the following apps using Titanium Backup:
About PlayStation Certified 1.0
Androidライブ壁紙 4.0.4-O_5_zw
Anonymous Usage Stats 1.0
ANT Radio Service 2.7
ANT Wireless State Notifier 1.0.1
Backup-Restore 1.0
com.android.wallpaper.holospiral 4.0.4-O_5_zw
CrashMonitor 1.0.A.0.1
Exchange サービス 4.1
Eメール 7.1.A.0.1
FMラジオ 3.0.A.0.4
Google歌詞プラグイン 5.0.A.0.1
McAfee Security 1.2.0.141
Mono 2.0
MusicFX 1.4
NFCサービス 4.0.4-O_5_zw
OfficeSuite 6.0.830
PlayNow 1.10.1
POBox Touch 5.1
Sakura 2.0
TrackID 3.60.49
WALKMAN 2.0.A.0.17
WALKMAN 5.0.A.0.11
Wisepilot 4.5
Woody 2.0
Xperia SmartTags 1.1.8
お勧めのダウンロード 2.4.12
キーチェーン 4.0.4-O_5_zw
タグ 1.1
ツール 1.0.A.0.17
トップ連絡先 1.11.0
ニュースと天気 1.3.04
ノート 7.0.A.0.22
バックアップと復元 1.0
バブル 1.0
ビジュアライザー 1.0.A.0.6
ヘルプ 6.1.13
マジックスモーク壁紙 4.0.4-O_5_zw
メモ 1.0.A.0.3
中国語キーボード 7.0.A.0.13
友達の音楽 4.0.A.0.16
地球 3.0.1
天気ウィジェット 2.0.A.0.17
店頭用デモ 2.18.0
最近の通話履歴 1.0.A.0.3
魔法の森 1.6.A.0.6

 

Of course, make a backup before doing this!


I did the upgrade on 2nd July, preparation for the upgrade took about 2 hours (installed latest FlashTool and then intercepted by Windows Update), flashing the ROM took about an hour. Spent half day for post configuration.


That's it!

 
SO-02D with EMOBILE SIM Card





















My ICS UI
























Saturday, May 19, 2012

Backup copy-protected DVD using Linux but...

I like watching drama and movie DVD and it is simple to create an iso backup for my favourite on Linux Mint platform. Just use Brasero and it gets the job well done... until few days ago.

When an iso file is created using Brasero, I run the following commands for integrity check as well as generate a new volume ID (mkisofs -V), mkisofs failed to generate a new iso file:

 








Brasero did not report any error during the creation of iso from this DVD. When I opened the iso file from Totem Movie Player and tried to play it, the following error message box appeared:







VLC media player could not play the movie too.

Different programs have been tried but none of them could fix the error (vobcopy, dvdbackup, ddrescue, dd). I even read somewhere saying Linux is not able to cope with the latest DRM, Oops!

Interestingly, the file system from those DVDs tricks the Linux OS about its VOB files with total size closed to 60GB! Further investigation tells me the DVD deployed more than one copy-protected techniques (other than CSS). The article from Gentoo Wiki explains what the problem is and suggests to use IfoEdit to fix the broken IFOs on Windows. After trying to repair several IFO files few times (through wine), I couldn't fix them. In addition, the DVD has 99 chapters, it is too time-consuming to fix all those IFO files, and if I know how!

According to one of the forum I came across it suggested to use DVDFab to rip the DVD and then use imgBurn to take care the rest. Oh no! I need to use Windows (I use it mainly to flash my Xperia phones.)! Therefore, I tried to install DVDFab Qt 8 on Windows 7, then used it to rip the DVD and it did not report any error. Next I used imgBurn to generate iso files, Volia! It worked! I ported those 2 programs into Linux Mint and did similar tests and all were ok.

To install wine:
vpcf1 ~ # apt install wine
Then you need to configure wine to add CD/DVD ROM drive letter:
penguin@vpcf1 ~ $ winecfg


To install DVDFab and imgBurn on Linux, you can just use the following commands (I installed them under /opt directory):
vpcf1 ~ # wine DVDFab8178Qt.exe &
vpcf1 ~ # wine SetupImgBurn_2.5.7.0.exe &
  
Once both programs are installed, rip the DVD using DVDFab, in my case the ripped files are saved under E: (/bittorrent/FullDisc/DVD_VIDEO). Leave the ripped files intact. Next, use imgBurn to generate an iso file from /bittorrent/FullDisc/DVD_VIDEO. When it finishes, your backup is ready!



In summary, to backup a movie DVD, you can:
Method 1
Use bundled Brasero on latest Linux Mint to create an iso.

 
Method 2
Use DVDFab to rip those intentional sector corruption DVD, then use imgBurn to create an iso file. Both can run under Linux through wine. How to use both programs are straightforward.



This morning I bought DVDFab DVD Copy but the license code cannot be registered on Wine.




Monday, March 19, 2012

CyanogenMod 7.1.0.1 on Xperia Arc S

You can find the update instructions from this wiki. I followed it and ended up in boot loop for CyanogenMod 7.1.0.2, so I went for 7.1.0.1 and no problem found. I post the steps and messages and hope you might find it useful here. Please note I installed CyanogenMod on Xperia Arc S (LT18i).



Pre-requisite
Download update-cm-7.1.0.1-XperiaArc-LT15i-signed.zip and validate its md5 checksum. You can find it here. Extract boot.img from the zip file and place it in your Android SDK directory. In my case I place it under dictory /opt/android-sdk-linux_x86/tools/. In addition, copy the zip file to the root of a microSD. A microSD is required for CyanogenMod installation.


Download gapps-gb-20110828-signed.zip and validate its md5 checksum. You can find it here. Copy the zip file to the root of a microSD.


Download fastboot for your respective platform from www.htcdev.com. Registration is required. Place the fastboot binary in your Android SDK directory. Same as where the boot.img is located.


Check if your device's bootloader can be unlocked by dialing *#*#7378423#*#*, select Service info, Configuration, you will find the following:
- IMEI, a 15 digits number, write it down
- Bootloader unlock allowed: Yes


Unlock Bootloader
Run the fastboot command from your terminal, it didn't work for me until I ran it from '../platform-tools' directory instead of '../tools' directory.

vpcp115kg platform-tools # ./fastboot oem unlock 0x{the key retrieved from Sony Ericsson}...
(bootloader) Unlock phone requested
(bootloader) Erasing block 0x00001300
(bootloader) Erasing block 0x00001400
(bootloader) Erasing block 0x00001500
(bootloader) Erasing block 0x00001600
(bootloader) Erasing block 0x00001700
(bootloader) Erasing block 0x00001800
(bootloader) Erasing block 0x00001900
(bootloader) Erasing block 0x00001a00
(bootloader) Erasing block 0x00001b00
(bootloader) Erasing block 0x00001c00
(bootloader) Erasing block 0x00001d00
(bootloader) Erasing block 0x00001e00
(bootloader) Erasing block 0x00001f00
OKAY [  4.538s]
finished. total time: 4.538s




Flash...
Run the following command to start flashing your handset:
vpcp115kg platform-tools # ./fastboot flash boot ../tools/boot.img
sending 'boot' (5228 KB)...
(bootloader) USB download speed was 9375kB/s
OKAY [  0.578s]
writing 'boot'...
(bootloader) Download buffer format: boot IMG
(bootloader) Flash of partition 'boot' requested
(bootloader) S1 partID 0x00000003, block 0x00000280-0x000002e3
(bootloader) Erase operation complete, 0 bad blocks encountered
(bootloader) Flashing...
(bootloader) Flash operation complete
OKAY [  1.057s]
finished. total time: 1.636s

 

then reboot it:
vpcp115kg platform-tools # ./fastboot reboot
rebooting...

finished. total time: 0.001s

 

While your phone is rebooting, press the Volume Up/Down button few times to trigger the CWM-based Recovery. Use Volume Up/Down button to navigate and Home button to select item, choose 'backup and restore' option to backup current Xperia installation:
CWM-based Recovery v5.0.2.6
SD Card space free: 7712MB
Backing up system...
Backing up data...
Backing up .android_secure...
Backing up cache...
No sd-ext found. Skipping backup of sd-ext.
Generating md5 sum...

Backup complete!

 

Next, select wipe data/factory reset, navigate to Yes -- delete all user data and press Home button to confirm:
-- Wiping data...
Formatting /data...
Formatting /cache...
Formatting /sd-ext...
Formatting /sdcard/.android_secure...
Data wipe complete

 

Next, select  wipe cache partition, then select Yes - Wipe Cache, press Home button to confirm:
-- Wiping cache...
Formatting /cache...
Cache wipe complete.



Lastly, select advanced, then select Wipe Dalvik Cache, then select Yes - Wipe Dalvik Cache and press Home button:
E:unknown volume for path [/sd-ext]
Dalvik Cache wiped.



Install CyanogenMod
Select install zip from sdcard, select choose zip from sdcard, select update-cm-7.1.0.1-XperiaArc-LT15i-signed.zip, select Yes - Install update-cm-7.1.0.1-XperiaArc-LT15i-signed.zip and press Home button:
--Installing: /sdcard/update-cm-7.1.0.1-XperiaArc-LT15i-signed.zip
Finding update package...
Opening update package...
Installing update...

Install from sdcard complete.



Select install zip from sdcard, select choose zip from sdcard, select gapps-gb-20110828-signed.zip and select Yes - Install gapps-gb-20110828-signed.zip and press Home button:
-- Installing: /sdcard/gapps-gb-20110828-signed.zip
Finding update package...
Opening update package...
Installing update...
GApps 20110828
 For Android 2.3.5
Mounting system...
Deleting old APKs...
Copying new APKs...
Unmounting system...
Installation complete!

Install from sdcard complete.



OK, you are done, select reboot system now from the main menu.



ICS 4.0 Beta from Sony Ericsson
This is a job log of flashing ICS 4.0 beta from Sony Ericsson about a month ago. You can just follow the instructions from their page. Oh, but it has no root, no wifi, no Google apps, uh-oh!
vpcp115kg platform-tools # fastboot flash boot ../tools/Xperia_arcS_ICS_beta/boot.img
sending 'boot' (4544 KB)...
(bootloader) USB download speed was 9381kB/s
OKAY [  0.503s]
writing 'boot'...
(bootloader) Download buffer format: boot IMG
(bootloader) Flash of partition 'boot' requested
(bootloader) S1 partID 0x00000003, block 0x00000280-0x000002e3
(bootloader) Erase operation complete, 0 bad blocks encountered
(bootloader) Flashing...
(bootloader) Flash operation complete
OKAY [  0.934s]
finished. total time: 1.437s
vpcp115kg platform-tools # fastboot flash userdata ../tools/Xperia_arcS_ICS_beta/userdata.img
sending 'userdata' (198 KB)...
(bootloader) USB download speed was 9216kB/s
OKAY [  0.025s]
writing 'userdata'...
(bootloader) Flash of partition 'userdata' requested
(bootloader) S1 partID 0x00000009, block 0x000012d0-0x00001fef
(bootloader) Erasing block 0x00001300
(bootloader) Erasing block 0x00001400
(bootloader) Erasing block 0x00001500
(bootloader) Erasing block 0x00001600
(bootloader) Erasing block 0x00001700
(bootloader) Erasing block 0x00001800
(bootloader) Erasing block 0x00001900
(bootloader) Erasing block 0x00001a00
(bootloader) Erasing block 0x00001b00
(bootloader) Erasing block 0x00001c00
(bootloader) Erasing block 0x00001d00
(bootloader) Erasing block 0x00001e00
(bootloader) Erasing block 0x00001f00
(bootloader) Erase operation complete, 0 bad blocks encountered
(bootloader) Flashing...
(bootloader) Flash operation complete
OKAY [  5.146s]
finished. total time: 5.170s
vpcp115kg platform-tools # fastboot flash system ../tools/Xperia_arcS_ICS_beta/system.img sending 'system' (229758 KB)...
(bootloader) USB download speed was 9367kB/s
OKAY [ 25.296s]
writing 'system'...
(bootloader) Flash of partition 'system' requested
(bootloader) S1 partID 0x00000004, block 0x000002f4-0x00000f73
(bootloader) Erasing block 0x00000300
(bootloader) Erasing block 0x00000400
(bootloader) Erasing block 0x00000500
(bootloader) Erasing block 0x00000600
(bootloader) Erasing block 0x00000700
(bootloader) Erasing block 0x00000800
(bootloader) Erasing block 0x00000900
(bootloader) Erasing block 0x00000a00
(bootloader) Erasing block 0x00000b00
(bootloader) Erasing block 0x00000c00
(bootloader) Erasing block 0x00000d00
(bootloader) Erasing block 0x00000e00
(bootloader) Erasing block 0x00000f00
(bootloader) Erase operation complete, 0 bad blocks encountered
(bootloader) Flashing...
(bootloader) Flash operation complete
OKAY [ 44.057s]
finished. total time: 69.353s
vpcp115kg platform-tools #