linux
Table of Contents
- Remind me after task done
- sort folders by size in command line
- use screen to run command in background
- Find files containing a particular text string
- GDB attach another process in Ubuntu
- Hide disk icons on the desktop
- gnome can not login?
- upgrade to Ubuntu 11.04 64bit
- Make ISO from directory
- upgrade to 4G RAM
Remind me after task done
ONEDAY write the note
- tts: festival
- notify-send
sort folders by size in command line
du --max-depth=1 /home/ | sort -nr
use screen to run command in background
detaching and reattaching
- detaching:
Ctrl+a d - reattaching:
screen -r
view all output
- scroll back after reattaching
- enable the copy mode:
Ctrl+a [ - disable the copy mode:
Ctrl+a ]
- enable the copy mode:
- enable/disable logging:
Ctrl+a H
Find files containing a particular text string
$ grep -r "text" /home/xu
GDB attach another process in Ubuntu
In Ubuntu 10.10 and later, users cannot ptrace processes that are not a descendant of the debugger. Run the following command to enable:
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
This will work until rebooting, change PERMANENT as following: change
kernel.yama.ptrace_scope = 1
to
kernel.yama.ptrace_scope = 0
in
/etc/sysctl.d/10-ptrace.conf .
Hide disk icons on the desktop
- luach gconf-editor
- go to app/nautilus/desktop
- uncheck volumes_visible
gnome can not login?
I tried to configure my desktop today ( change the input method in fact), but then I can not login anymore! I searched in the internet, there are so many possible problem… the real problem is that I can not find out what is wrong! The solution is to see ~/.xsession-errors
upgrade to Ubuntu 11.04 64bit
- Install Ubuntu (Note: choose mount point/partition by ourselves)
- Reboot
- Configure
/etc/fstabto mount all the partitions - Install
emacs&emacs-goodies-el(to write this notes :) (Note: find problem with--debug-init)- add to quick laucher
cp /usr/share/applications/emacs23.desktop ~/.local/share/applications/- editor
~/.local/share/applications/Exec to command that I use (a shell script), the result file:
- add to quick laucher
[Desktop Entry] Version=1.0 Name=GNU Emacs 23 GenericName=Text Editor Comment=View and edit files MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; Exec=sh /media/Data/git/projects/bash/editor %F TryExec=emacs23 Icon=/usr/share/icons/hicolor/scalable/apps/emacs23.svg Type=Application Terminal=false Categories=Utility;Development;TextEditor;
- Install
thunderbird - Install printer
- Install Sun Java
- Synaptic Package Manager>Settings>Repositories
- Select
Other Softwarethen Mark theCanonical Partners - In the
Quick Searchbox, write "sun java", install jre and jdk sudo update-alternatives --config javachoose sun java
- Use Empathy instaed of Pidgin, it is integrated better with gnome, and the chat history remains!
- Programming
- Install Netbeans
- Install premake4
- Install git
- Install bzr
- Chinese setup
- Install Dropbox
- Install Guake
Because the Super key is used by Unity, so I have to change the shortcut of Guake to Alt+c, it is a little inconvenient. And modify the source code ( /usr/lib/guake/guake.py ) to put the Guake in the bottom of screen, like this:
def get_final_window_rect(self): """Gets the final size of the main window of guake. The height is the window_height property, width is window_width and the horizontal alignment is given by window_alignment. """ screen = self.window.get_screen() height = self.client.get_int(KEY('/general/window_height')) width = 100 halignment = self.client.get_int(KEY('/general/window_halignment')) # get the rectangle just from the first/default monitor in the # future we might create a field to select which monitor you # wanna use window_rect = screen.get_monitor_geometry(0) total_width = window_rect.width total_height = window_rect.height # total height of screen window_rect.height = window_rect.height * height / 100 window_rect.width = window_rect.width * width / 100 if width < total_width: if halignment == ALIGN_CENTER: window_rect.x = (total_width - window_rect.width) / 2 elif halignment == ALIGN_LEFT: window_rect.x = 0 elif halignment == ALIGN_RIGHT: window_rect.x = total_width - window_rect.width window_rect.y = (total_height - window_rect.height) # set y return window_rect
- Remove Apache: why do I need http server in my laptop??
- Install "Flash Aid" plugin of Firefox
Make ISO from directory
mkisofs -o /tmp/cd.iso /tmp/directory
upgrade to 4G RAM
- install PAE (Physical Address Extension) kernel to support 4G RAM (update: I use 64Bit system instead now! )
- mount
/tmpto RAM by adding this line in/etc/fstab# mount tmpfs in /tmp/ tmpfs /tmp tmpfs size=1024m,mode=1777 0 0
- change swappiness:
add
vm.swappiness=10in/etc/sysctl.conf
Test
- Copy/remove files to
/tmp, it is really fast! - Compile our project
The results doesn't show tmpfs is faster, however I think this is becauseext4 tmpfs make 4m20.378s 4m18.120s make -j2 2m48.749s 2m50.457s /dev/shm. The CPU is bottle neck now.