[Ubuntu] Intel CPU Temperature Sensors

Install:

# apt-get install lm-sensors

Load module

# modprobe coretemp

My laptop CPU temperature… lol

# sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +70.0°C  (crit = +96.0°C)
temp2:        +60.0°C  (crit = +113.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +66.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:       +71.0°C  (high = +100.0°C, crit = +100.0°C)

[Ubuntu] VirtualBox Install

https://www.virtualbox.org/

Install:

# dpkg -i virtualbox-4.1_4.1.22-80657~Ubuntu~precise_amd64.deb

File > Preferences > Extension >

Add : Oracle_VM_VirtualBox_Extension_Pack-4.1.22-80657.vbox-extpack

Change group to enable usb support

# usermod -a -G vboxusers <username>

[Ubuntu] SmartCard Reader issue

EZ100PU driver:

http://www.castech.com.tw/in-download-02.aspx?cid=C_00000001&id=P_00000001

install driver and install pcsc

# apt-get install pcscd pcsc-tools

# vi /etc/udev/rules.d/92-pcscd-ccid.rules

# If not adding the device, go away
ACTION!="add", GOTO="pcscd_ccid_rules_end"
SUBSYSTEM!="usb", GOTO="pcscd_ccid_rules_end"
ENV{DEVTYPE}!="usb_device", GOTO="pcscd_ccid_rules_end"

# Castles Technology Co., Ltd EZUSB PC/SC Smart Card Reader
ATTRS{idVendor}=="0ca6″, ATTRS{idProduct}=="0010″, GROUP="pcscd"

# All done
LABEL="pcscd_ccid_rules_end"

must correct idVender and idProduct by # lsusb

then restart udev # service udev restart

# pcscd -f

# pcsc_scan

http://softsmith.blogspot.tw/2011/10/ubuntu-1110-webatm.html

[Ubuntu] MySQL誤刪root忘記密碼

剛剛不小心誤刪root…真是悲劇

1.關閉服務
#/etc/init.d/mysql stop

2.安全模式啟動,不檢查權限
#mysqld_safe –-skip-grant-tables &

3.進入mysql指令
#mysql

4.選擇mysql資料庫
mysql> use mysql

5.加入名為root的user
mysql> insert into user set user=’root';

6.更新密碼
mysql> update user set password=password(‘123456′) where user=’root';

7.更新權限設定
mysql> update user set Host=’localhost’,select_priv=’y’, insert_priv=’y’,update_priv=’y’,
Alter_priv=’y’,delete_priv=’y’,create_priv=’y’,drop_priv=’y’,reload_priv=’y’,shutdown_priv=’y’,
Process_priv=’y’,file_priv=’y’,grant_priv=’y’,References_priv=’y’,index_priv=’y’,create_user_priv=’y’,
show_db_priv=’y’,super_priv=’y’,create_tmp_table_priv=’y’,Lock_tables_priv=’y’,execute_priv=’y’,
repl_slave_priv=’y’,repl_client_priv=’y’,create_view_priv=’y’,show_view_priv=’y’,create_routine_priv=’y’,
alter_routine_priv=’y’,create_user_priv=’y’,Event_priv=’y’,Trigger_priv=’y’ where user=’root';

8.套用新權限
mysql> flush privileges;

9.離開mysql
mysql> quit

10.強制關閉mysql服務
#killall mysqld

11.正常啟動mysql
#/etc/init.d/mysql start