Posts

Showing posts from 2013

อะไรคือ KDE Plasma Activities และการใช้งาน

ผมใช้ Kubuntu มาสักระยะแล้ว ประมาณ 1-2 ปี มี feature หนึ่งที่เพิ่งมาสนใจอย่างจริงจัง คือ Activities และหลังจากได้ค้นหาวิธีใช้สักพัก มันก็เหมือนกับ การสร้าง profile desktop เก็บเอาไว้ตัวอย่างเช่น เครื่องของผมมี activities 2 อันคือ Workplace และ Home ใน Workplace จะมี konsole เปิด service ที่ต้องการรันทิ้งไว้ และ ide รวมทั้ง widget สำหรับแสดง folder กะแสดงไว้ใน profile นี้ ส่วน Home ก็ไม่มีอะไรมากอาจจะมี browser ทิ้งไว้ หรือ ไม่ก็มี deluge รันอยู่ หนทางในการสลับ activities โดยใช้ keyboard ผมอ้างอิงได้จาก  http://blog.hanschen.org/2011/05/15/7-ways-to-switch-activities/ ซึ่งผมได้เลือกวิธี meta + tab มาใช้คับ

KDE Plasma Applet lost unreasonable and how to remove them

I had some plasma applet that display hardware temperature, trash. Unfortunately they're gone. I don't know why. But I know they still valid because I try add it again in main screen but they got green 'correct' sign ( which it's mean they still valid somewhere ). I feel unhappy because I want to remove them but I can't see them.  So here is the way I found from google ( http://ubuntuforums.org/showthread.php?t=1920398 ) Let's find  ~/.kde/share/config/plasma-desktop-appletsrc  (don't forget to backup this file) then remove path that you want ( as you can't see in screen but it's checked in add widget dropdown menu ), then kill plasma-desktop process, and start it again.

Short Note about linux redirection

While i run test script (it's usually output to stderr if it's error). Many times an error is too big to display in one display. So i am thinking about linux redirect >> ./runtests 2>&1 | head Summary    M>N,  M discriptor to filename N    M>&N, M discriptor to another N discriptor

Disable touchpad while using keyboard

It's just 1. Installing kde-config-touchpad package 2. Goto startup-menu, run utilities->touchpad management 3. Find the option "Automatically switch off touchpad" on Keyboard activity ref to  http://askubuntu.com/questions/46299/how-to-disable-touchpad-tapping-when-typing-on-keyboard

Thank Red Damn Dell.

I just finish clean The Red Damn Dell ( Desktop replacement, dell with red cover ).  It 's great machine, not built-in graphic, supreme power. It's work together with me for about 2 yrs. Like a Tank. It's most powerful but heavy. I want some lightweight , when my company employee resign his lightweight x220 come to my hand. That's it. Thank Red Damn Dell , you are the man.

Access chroot via SSH

(ref  http://wiki.mandriva.com/en/Development/Howto/Chroot ) 1. Enter to chroot 2. Setup openssh-server 3. Edit /etc/ssh/sshd_config     Port 2222 4. Launch sshd daemon inside chroot 5. Add user/pass inside chroot 6. From outside, try ssh user@localhost -p 2222

How to explode DEBian package file.

I wrote this because My senior need to get uwsgi ( newer version ) than registered in precise repos. At that time we found great guy Chris Lea ( https://launchpad.net/~chris-lea/+archive/uwsgi ), thank chris :). But if we don't found him. I plan to explode current debian version from precise repos to see the structure and all script. Here is how to do that Get one (deb pkg) i assume uwsgi-current.deb 1. The first way Using dpkg-deb -x , you will get inside debian structure. > dpkg-deb -x uwsgi-current.deb [target-folder] Using dpkg-deb --control , you will get control files, debian control scripts. > dpkg-deb --control uwsgi-current.deb [target-folder] /DEBIAN 2. The second way,  the first way can be done in short time in  > dpkg-deb -R uwsgi-current.deb [target-folder]

Cool! Icon sets

2 Weeks ago, I do new setup of Kubuntu. Trying to find cool icon sets, so i found icon set "Ksticker" by samuaz (  http://opendesktop.org/content/show.php?content=158891  ). That's nice and cool, Thank you samuaz, Great Job:)

Kubuntu is too slow in updating content during resizing window!!!

Hi Siraset and Friend     I often found this problem ( kubuntu 's too slow in updating content during resizing window ). It's show a bad pixel or texture when do quickly resizing window. I end up with reinstall kubuntu, graphic driver many times. This is a things that I found when idea about turn off all DESKTOP EFFECT then try resizing and see if that damn problem occur or not. Finally I found nothing bad. Graphic during resizing is good even in high resolution and high cpu mode. So I begin to try to turn on each one effect and see which one is ruin my system. I cannot remember which one is the damn but currently I can select the effect that 's not ruin my system. So this is my concern, if you found problem like this let's turn off all effect and try one on one.

Python module search order

The search order is important! 1.Program's working directory 2.$PYTHONPATH directories 3.Python standard library directories 4.(and any .pth path files) ref  http://www.curiousvenn.com/wp-content/uploads/2013/07/modules_101.pdf

New to Kubuntu 12.10 with my old ATI

If you have ATI graphic card 2xxx-4xxx like me. You will found problem such as kubuntu can not find you graphic card adapter. It's pain. I spend my time google then I have got keyword "fglrx-legacy-driver". Googling it then something like this come up!!  http://www.ubuntuvibes.com/2012/10/how-to-install-amd-catalyst-legacy.html  . I tried it and it's works. Currently I use external monitor , that doesn't not work now. I just something I found during googling are make your kubuntu know you have attached external monitor run kdesudo amdcccle goto display manager then check if you see 2 screens active (that's a good luck) goto terminal, run command sudo aticonfig --initial ( hope you will get xorg.conf which contain detail of current state ) reboot then wish you luck

Grep option from Jua

Today tasks, when we want to grep something we use >> ls -l | grep Jua tell me, if i need everything except >> ls -l | grep -v    # I think it's come from exclude by help said invert match!!! ### Thank Jua :) Anyway, we can use some simple regular expression by >> ls -l | grep -e [regex] such as >> ls -l | grep -e ^B

Clean chroot manually

I mess around schroot, chroot and mkschroot(  https://github.com/KayEss/mkschroot  ). Done something with blind but do not want to remove them with blind So!!! thank for link at the page's bottom. The instruction below are what I have done for remove unwanted chroot. 1. Check mounted sys by     >> df -ah     * you will see chroot mount path. 2. Goto /var/lib/schroot     - remove your's chroot inside session's dir     - do unmount  proc sys dev/pts dev tmp  in your's chroot from mount's dir     * I'd use     >> for f in proc sys dev/pts dev tmp;do sudo umount $f;done;     - do unmount your's chroot     thank for  http://manpages.ubuntu.com/manpages/natty/man7/schroot-faq.7.html

Write a better python with Guide

I found this during i sit down in Lib of Burapha U. http://docs.python-guide.org/en/latest/ , it look like interesting guide and worth to read. :) thanks, hitchhiker

Pygame dependencies

http://www.pygame.org/wiki/CompileUbuntu Python 2.x #install dependencies sudo apt-get install mercurial python-dev python-numpy ffmpeg \ libsdl-image1. 2 -dev libsdl-mixer1. 2 -dev libsdl-ttf2. 0 -dev libsmpeg-dev \ libsdl1. 2 -dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev   # Grab source hg clone https://bitbucket.org/pygame/pygame   # Finally build and install cd pygame python setup.py build sudo python setup.py install

Wireless card looping write log

If you found these line in your kern.log, syslog Jan 27 13:54:51 xango3 kernel: [98499.658770] ERROR @wl_cfg80211_ get_station : Could not get rate (-1) Jan 27 13:54:51 xango3 kernel: [98499.658778] ERROR @wl_cfg80211_ get_station : Could not get rssi (-1) Jan 27 13:54:52 xango3 dhclient: DHCPREQUEST of 192.168.1.133 on eth2 to 192.168.1.2 port 67 Jan 27 13:54:56 xango3 kernel: [98504.646146] net_ratelimit: 22 callbacks suppressed Jan 27 13:54:56 xango3 kernel: [98504.646152] ERROR @wl_cfg80211_ get_station : Could not get rate (-1) Jan 27 13:54:56 xango3 kernel: [98504.646158] ERROR @wl_cfg80211_ get_station : Could not get rssi (-1) Jan 27 13:54:57 xango3 kernel: [98505.562569] ERROR @wl_cfg80211_ get_station : Could ... That mean something happen like in  https://bugs.launchpad.net/ubuntu/+source/bcmwl/+bug/1107155 and Oedipe point me to the exit " Well, after some hours trying to solve the issue, i found the trick ! (it does work for me on a Lenovo with a BCM4312)

My current xorg.conf 20130319

Compiz Fusion -> compiz selected Enabled -> Additional Drivers for ATI/AMD, Broadcom STA wireless driver  ================ Begin Section "ServerLayout"         Identifier     "amdcccle Layout"         Screen      0  "amdcccle-Screen[2]-0" 0 0     Screen      1  "amdcccle-Screen[2]-1" 0 0         EndSection Section "Module"         Load  "glx" EndSection Section "ServerFlags"         Option      "Xinerama" "off" EndSection Section "Monitor"         Identifier   "0-LVDS"         Option      "VendorName" "ATI Proprietary Driver"         Option      "ModelName" "Generic Autodetecting Monitor"         Option      "DPMS" "true"         Option      "PreferredMode" "1920x1080"         Option      "TargetRefresh" "60"         Option      "Position"

Mysql Command Pages Links

http://www.pantz.org/software/mysql/mysqlcommands.html  ( thank pantz )

About DPKG

ref  http://www.cyberciti.biz/howto/question/linux/dpkg-cheat-sheet.php ref  http://linuxprograms.wordpress.com/2010/05/14/dpkg-tutorial/ Very thank for Owners of 2 links above. The first column corresponds to the status of a package. How to interpret this status. Status of every package is represented by  three characters xxx Let’s explore each of the character signify. First character : The possible value for the first character. The first character signifies the desired state, like we (or some user) is marking the package for installation u: Unknown (an unknown state) i: Install (marked for installation) r: Remove (marked for removal) p: Purge (marked for purging) h: Hold Second Character : The second character signifies the current state, whether it is installed or not. The possible values are n: Not- The package is not installed i: Inst – The package is successfully installed c: Cfg-files – Configuration files are present u: Unpacked- The package is stille

Bash Shortcuts

These content are from SKORKS ( http://www.skorks.com/2009/09/bash-shortcuts-for-maximum-productivity/ ), Thanks Alan Skorkin Command Editing Shortcuts Ctrl + a  – go to the start of the command line Ctrl + e  – go to the end of the command line Ctrl + k  – delete from cursor to the end of the command line Ctrl + u  – delete from cursor to the start of the command line Ctrl + w  – delete from cursor to start of word (i.e. delete backwards one word) Ctrl + y  – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor Ctrl + xx  – move between start of command line and current cursor position (and back again) Alt + b  – move backward one word (or go to start of word the cursor is currently on) Alt + f  – move forward one word (or go to end of word the cursor is currently on) Alt + d  – delete to end of word starting at cursor (whole word if cursor is at the beginning of word) Alt + c  – capitalize to end of word starting

Recursive rename in python script

#!/usr/bin/env python import fnmatch import os root = os.getcwd() pattern = "*.JPG" for root, dirs, files in os.walk(root):     for filename in fnmatch.filter(files, pattern):         #print (os.path.join(root, filename))         full_src = os.path.join(root, filename)         full_dst = full_src.replace('.JPG','.jpg')         os.rename(full_src, full_dst)         print "Renaming {0} to {1}".format(full_src, full_dst)

Noted from Wizard's Hero K

This is the note from chatting with Wizard's Hero K of Proteus-Tech. I derived them to keywords. stdin, stdout, stderr mixin of stdout and stderr PTY ELF mkfifo ( explicit pipe ) stderrred LD_PRELOAD buffer read between user program and varanus/profab/buildbot/fabric buildbot has miss order problem may cause of the buffer read see in buildbot waterfall, the traceback error come before the command that generate it. in c/c++ \r and \n act in different way in linux and window std:flush, std:out printf  :) Have recall my knowledge!! Thank Wizard K

Combination of commands to remove something

I wanna move some folder name pip-* , every folders to /mnt/tmp3. But monitor server does not allow me to do it. So i keep do it 100 folders each time. I end up with this below $ ls -tr | grep pip- | head -n100 | xargs -i{} sudo mv {} /mnt/tmp3