Monday, July 6, 2015

Change config.txt to resolve HDMI resolution issue on Raspberry Pi.

[1] https://www.raspberrypi.org/documentation/configuration/config-txt.md

HDMI_IGNORE_EDID

Setting this to 0xa5000080 enables the ignoring of EDID/display data if your display doesn't have an accurate EDID. It requires this unusual value to ensure that it doesn't get triggered accidentally.

Enable Hibernate in Win7.


Ref [1] http://www.sevenforums.com/tutorials/778-power-plan-settings-change.html
      [2] http://www.sevenforums.com/tutorials/819-hibernate-enable-disable.html

Enable hibernate in advanced power plan settings.
( command line to open power settings: powercfg.cpl  )

Wednesday, May 6, 2015

查看微信的聊天记录的方法

From: http://zhidao.baidu.com/question/982655918229473339.html

查看微信的聊天记录的方法

首先我们需要准备 电脑一台、SD卡、手机的USB。
其次,因为语音聊天记录的备份和提取无需root,这些内容都备份在SD卡上。所以,我们首先将手机通过USB连接到电脑上,然后通过电脑打开SD卡所在的文件夹,找到:/sdcard/Tencent/MicroMsg/
接着,打开对应的备份文件夹,正常都是一堆数字和字母组成文件名的文件夹。进入后,找到“voice”文件夹。
文件夹里的arm格式文档就是所有的聊天语音记录。只要把这些文件存下来,则语音聊天记录给备份下来。
注意,导出文本聊天记录就需要把手机进行root,只有在root后才能进行文本聊天记录的!让我们首先先把手机进行root~
root完成后,打开\data\data\com.tencent.mm\MicriMsg 文件夹,里面会有一个以很长一串数字或者一些字母组成命名的文件夹(也可能有多个。不同的文件夹名代表不同的QQ,如果你用不同的QQ登陆过微信,每个 QQ会产生一个新乱码文件夹,保险起见,可以都备份上)把此文件夹备份出来,文件夹里还有个systemInfo.cfg文件可以不用备份!
然后进入找到MicroMsg.db文件,就是它了,这就是存储好友号码、昵称、聊天记录的数据库文件。想备份,简单,直接复制了就得!想要打开和导出为文本什么的,下载个SQLite相关软件就能做到了

Friday, November 7, 2014

Expand Ubuntu Drive Size Running in VM Player

Ref
[1] http://superuser.com/questions/795699/how-to-extend-the-primary-partition-for-ubuntu-server-running-in-vmware-player
[2] http://www.in8sworld.net/blog/archives/3912
[3] http://blog.pluralsight.com/resize-vmware-linux-drives
[4] http://askubuntu.com/questions/429576/increase-ubuntu-partition-size-under-virtual-machine
[5] http://askubuntu.com/questions/294889/how-to-expand-the-ext4-primary-partition-size-in-a-vmware-player-virtual-disk
[6] http://xmodulo.com/how-to-change-the-boot-order-of-guest-vm-on-vmware-player.html  F2 into VM guest BIOS
[7] http://unix.stackexchange.com/questions/108199/centos-cant-use-new-extented-space-on-system-disc
[8] http://gparted-forum.surf4.info/viewtopic.php?id=16987

Adding following line into *.vmx file if too short to hit F2 key
--------------------
bios.bootDelay = "<number_of_milliseconds>"
bios.forceSetupOnce = "TRUE"

Command line option (run after boot VMWare from GParted disc or iso)
----------------------
--Start fdisk and display current partition---
# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.2).
Command (m for help): p
Device Boot         Start         End      Blocks   Id  System
/dev/sda1            2048    39845887    19921920   83  Linux
/dev/sda2       207607995   209712509     1052257+   5  Extended
/dev/sda5       207611904   209712509     1050303   82  Linux swap / Solaris

--Delete /dev/sda1-----
Command (m for help): d
Partition number (1,2,5, default 5): 1
Partition 1 is deleted

--Create new primary partition----
Command (m for help): n
Partition type:
   p   primary (0 primary, 1 extended, 3 free)
   l   logical (numbered from 5)
Select (default p): p
Partition number (1,3,4, default 1): 1
First sector (2048-209715199, default 2048):    <==== This MUST be the same as in the original partition table!
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-207607994, default 207607994):  <== Use the default, will be maximum it can do
Using default value 207607994
Partition 1 of type Linux and of size 99 GiB is set

--Write new partition-----
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

--Check file system consistence----
# e2fsck -f /dev/sda1
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda1: 11/1245184 files (0.0% non-contiguous), 122210/4980480 blocks

--Resize partition----
# resize2fs /dev/sda1
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/sda1 to 25950743 (4k) blocks.


In my own practice, /dev/sda2 sectors straight after /dev/sda1/, so either change /dev/sda2/  and /dev/sda5/ start sectors, or just delete /dev/sda2 and /dev/sda5, then all unassigned sectors can be added to new /dev/sda1






Above is resizing 'primary partition'. Below is for resize partition on logical volume [7]
---------------------------------------------------
Baisc relationship among PhysicalVolume(PV), VolumeGroup(VG) and LogicalVolume(LV):
PV (/dev/sda2) -> VG (turnkey) -> LV (root)
Resize PV, then extend LV, then resize2fs /dev/VG/LV .....

---expand guest OS disk space from 20G to 200G
Using VMWare disk -> utilities -> Expand

---resize LVM in GParted GUI mode from 20G to 200G
Remember to partition->deactivate LVM2 PV before resizing. [8]

---run following commands after starting debian
root@trac ~# pvs
  PV         VG      Fmt  Attr PSize   PFree
  /dev/sda2  turnkey lvm2 a--  199.52g 182.02g
root@trac ~# lvs
  LV     VG      Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
  root   turnkey -wi-ao--  17.00g
  swap_1 turnkey -wi-ao-- 512.00m
root@trac ~# vgs
  VG      #PV #LV #SN Attr   VSize   VFree
  turnkey   1   2   0 wz--n- 199.52g 182.02g

---before adding newly allocated space into LVM
root@trac ~# df -h
Filesystem                Size  Used Avail Use% Mounted on
rootfs                     17G  893M   16G   6% /
udev                       10M     0   10M   0% /dev
tmpfs                     101M  172K  101M   1% /run
/dev/mapper/turnkey-root   17G  893M   16G   6% /
tmpfs                     5.0M     0  5.0M   0% /run/lock
tmpfs                     201M     0  201M   0% /run/shm
/dev/sda1                 415M   19M  375M   5% /boot

---Run following commands
root@trac ~# pvresize /dev/sda2
root@trac ~# lvextend /dev/mapper/turnkey-root /dev/sda2
root@trac ~# resize2fs /dev/turnkey/root

---Afterwards, checking again. It's done.
root@trac ~# df -h
Filesystem                Size  Used Avail Use% Mounted on
rootfs                    196G  909M  186G   1% /
udev                       10M     0   10M   0% /dev
tmpfs                     101M  172K  101M   1% /run
/dev/mapper/turnkey-root  196G  909M  186G   1% /
tmpfs                     5.0M     0  5.0M   0% /run/lock
tmpfs                     201M     0  201M   0% /run/shm
/dev/sda1                 415M   19M  375M   5% /boot





root@trac ~# pvs
  PV         VG      Fmt  Attr PSize   PFree
  /dev/sda2  turnkey lvm2 a--  199.52g 182.02g
root@trac ~# lvs
  LV     VG      Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
  root   turnkey -wi-ao--  17.00g
  swap_1 turnkey -wi-ao-- 512.00m
root@trac ~# vgs
  VG      #PV #LV #SN Attr   VSize   VFree
  turnkey   1   2   0 wz--n- 199.52g 182.02g
root@trac ~# df -h
Filesystem                Size  Used Avail Use% Mounted on
rootfs                     17G  893M   16G   6% /
udev                       10M     0   10M   0% /dev
tmpfs                     101M  172K  101M   1% /run
/dev/mapper/turnkey-root   17G  893M   16G   6% /
tmpfs                     5.0M     0  5.0M   0% /run/lock
tmpfs                     201M     0  201M   0% /run/shm
/dev/sda1                 415M   19M  375M   5% /boot
root@trac ~# pvresize /dev/sda2
  Physical volume "/dev/sda2" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized
root@trac ~# lvs
  LV     VG      Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
  root   turnkey -wi-ao--  17.00g
  swap_1 turnkey -wi-ao-- 512.00m
root@trac ~# lvextend /dev/mapper/turnkey-root /dev/sda2
  Extending logical volume root to 199.02 GiB
  Logical volume root successfully resized
root@trac ~# lvs
  LV     VG      Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
  root   turnkey -wi-ao-- 199.02g
  swap_1 turnkey -wi-ao-- 512.00m
root@trac ~# resize2fs /dev/turnkey/root
resize2fs 1.42.5 (29-Jul-2012)
Filesystem at /dev/turnkey/root is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 13
Performing an on-line resize of /dev/turnkey/root to 52171776 (4k) blocks.
The filesystem on /dev/turnkey/root is now 52171776 blocks long.

root@trac ~# df -h
Filesystem                Size  Used Avail Use% Mounted on
rootfs                    196G  909M  186G   1% /
udev                       10M     0   10M   0% /dev
tmpfs                     101M  172K  101M   1% /run
/dev/mapper/turnkey-root  196G  909M  186G   1% /
tmpfs                     5.0M     0  5.0M   0% /run/lock
tmpfs                     201M     0  201M   0% /run/shm
/dev/sda1                 415M   19M  375M   5% /boot

#man lvextend
.....
Examples
       "lvextend -L +54 /dev/vg01/lvol10 /dev/sdk3" tries to extend the size of that logical volume by 54MB on physical volume /dev/sdk3.  This is only possible if
       /dev/sdk3 is a member of volume group vg01 and there are enough free physical extents in it.

       "lvextend /dev/vg01/lvol01 /dev/sdk3" tries to extend the size of that logical volume by the amount of free space on physical  volume  /dev/sdk3.   This  is
       equivalent to specifying "-l +100%PVS" on the command line.

       "lvextend -L+16M vg01/lvol01 /dev/sda:8-9 /dev/sdb:8-9"
       tries to extend a logical volume "vg01/lvol01" by 16MB using physical extents /dev/sda:8-9 and /dev/sdb:8-9 for allocation of extents.


Surprisingly fast when do it for fedora20 (Only a couple of seconds)
---------------------------------------------------------------------
1. Expand in VMWare on fedora20 disk space from 20G to 250G
2. GParted iso start up and resize LVM2 PV from 20G to 250G to include new unallocated new space from VMware expansion.
3. Restarted into Fedora20. run lvextend, and resize2fs. A few seconds for this on-line resizing. Done

[root@fedora20 q.yang]# lvextend /dev/mapper/fedora_192-root /dev/sda2
Extending logical volume root to 247.51 GiB Logical volume root successfully resized [root@fedora20 q.yang]# resize2fs /dev/fedora_192/root resize2fs 1.42.12 (29-Aug-2014) Filesystem at /dev/fedora_192/root is mounted on /; on-line resizing required old_desc_blocks = 2, new_desc_blocks = 16 The filesystem on /dev/fedora_192/root is now 64882688 (4k) blocks long. [root@fedora20 q.yang]# df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 988M 0 988M 0% /dev tmpfs 997M 152K 997M 1% /dev/shm tmpfs 997M 884K 996M 1% /run tmpfs 997M 0 997M 0% /sys/fs/cgroup /dev/mapper/fedora_192-root 244G 16G 219G 7% / tmpfs 997M 32K 997M 1% /tmp /dev/sda1 477M 146M 302M 33% /boot /dev/sr0 229M 229M 0 100% /run/media/q.yang/GParted-live
   

Friday, August 22, 2014

Install Google chrome in Fedora20

[1]   http://www.if-not-true-then-false.com/2010/install-google-chrome-with-yum-on-fedora-red-hat-rhel/

cat << EOF > /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome - \$basearch
baseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
EOF

#yum install google-chrome-stable

-Start chrome
$google-chrome


Install GNOME Weather in Fedora 20


[1] http://askubuntu.com/questions/302590/how-to-install-a-clock-or-weather-application-with-gnome-3-8
[2] http://fedoraftw.com/enjoy-weather-data-fedora-20-polished-gnome-weather


-Install gnome-weather with root account

# yum install gnome-weather

...........
  Installing : gnome-weather-3.10.1-1.fc20.x86_64                           1/1
  Verifying  : gnome-weather-3.10.1-1.fc20.x86_64                           1/1

Installed:
  gnome-weather.x86_64 0:3.10.1-1.fc20                                         

Complete!


-Start gnome-weather

$gnome-weather



Wednesday, June 11, 2014

Enable SSH service in Fedora20 in command line


[root@fedora20 SandBoxPython]# systemctl enable sshd.service
ln -s '/usr/lib/systemd/system/sshd.service' '/etc/systemd/system/multi-user.target.wants/sshd.service'
[root@fedora20 SandBoxPython]# systemctl restart sshd.service