This is how we use a command line / bash variable (named num) in a awk command. We define an awk variable 'var' with -v option. This also shows use of BEGIN block.
awk -F, -v var=$num 'BEGIN{srand(var)} {print $1","$2","rand()}' file_name
A few Day-to-Day life tricks of Linux.
This is how we use a command line / bash variable (named num) in a awk command. We define an awk variable 'var' with -v option. This also shows use of BEGIN block.
awk -F, -v var=$num 'BEGIN{srand(var)} {print $1","$2","rand()}' file_name
We can directly change the contents of the file but they dont seem to be in effect. So I added Google's nameserver in the file as follows :
$ sudo cat /etc/resolvconf/resolv.conf.d/base
nameserver 8.8.8.8
nameserver 8.8.4.4
And then updated the file as follows :
$ sudo resolvconf -u
we can also just update /etc/resolve.conf and it will be in effect immediately.
$ sudo sed -i '1 i\nameserver 8.8.8.8\nnameserver 8.8.4.4' /etc/resolv.conf
To remove the changes :
$ sudo sed -i '1,2d' /etc/resolv.conf
IF we want to rename all the files with a part of the file we can do something following:
for file in $(ls); do nn=$(echo $file | awk -F'_' '{print($2)}'); mv $file $nn; done
Easy command to loop through the dates :
for i in 2022-01-{01..31} 2022-02-{01..15}; do echo $i; done
More comprehensive command :
d=2015-01-01
while [ "$d" != 2015-02-20 ]; do
echo $d
d=$(date -I -d "$d + 1 day")
done
Recently got tp-link T3u mini wifi adapter but as usual ubuntu did not have its drivers. So executed following commands and it worked perfectly.
cd /opt
git clone https://github.com/cilynx/rtl88x2bu.git
cd rtl88x2bu
VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf)
sudo rsync -rvhP ./ /usr/src/rtl88x2bu-${VER}
sudo dkms add -m rtl88x2bu -v ${VER}
sudo dkms build -m rtl88x2bu -v ${VER}
sudo dkms install -m rtl88x2bu -v ${VER}
sudo modprobe 88x2bu
Typically, if you dont have sudo and "gain" sudo access, you cant just add yourself to sudo group. In that scenario, we need to reboot in "advanced mode" and gain access to root shell. Once in, you can have following :
$ sudo cat /etc/sudoers.d/hpatil
hpatil ALL=(ALL) ALL
and then we will have sudo access.
sudo dd bs=4M if=~/Downloads/ of=/dev/sdc1 status=progress oflag=syncyou can find out /dev/sdc1 via df command.
sudo apt install libx11-dev libxcomposite-dev libxdamage-dev libxrender-dev
mkdir ~/git
cd git
git clone https://github.com/Carpetsmoker/find-cursor.git
cd find-cursor
make
echo "bindsym $mod+F5 exec /home/maahi/git/find-cursor/find-cursor -of" >> ~/.config/i3/config
sudo echo 'deb https://apt.dockerproject.org/repo debian-stretch main' > /etc/apt/sources.list.d/dockertemp.listOnce installation was done, these were basic commands I used :
sudo apt-get update
sudo apt-get install docker-engine
sudo rm /etc/apt/sources.list.d/dockertemp.list sudo service docker start
https://sakuli.readthedocs.io/en/v1.0.0/docker-containers/
sudo docker pull harsshal/tws:first
sudo docker run -it -p 5901:5901 -p 8000:6901 harsshal/tws:first
sudo docker run -it -p 5901:5901 -p 8000:6901 -exec -u 0 harsshal/tws:first /bin/bash
sudo docker run -it -p 5901:5901 -p 8000:6901 -e "VNC_PW=ibtrader" harsshal/tws:first
sudo docker ps -a
sudo docker start
sudo docker commitharsshal/tws:second
sudo docker push harsshal/tws:second
sudo docker images
sudo docker ps -a | awk '{print $1}' | xargs sudo docker rm
import pandas as pd
pd.set_option('display.max_rows', 500)
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
SELECT median(val) over() FROM (
SELECT * from (SELECT 1 as val, 1 as row
UNION SELECT 2, 2
UNION SELECT NULL,3
UNION SELECT NULL,4
UNION SELECT 4,5)temp
)temp2;
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
i3-save-tree > i3.jsonWe need to edit json file so that "class" entries in "swallows" sections are un-commented.
exec load_i3_layout.shWhere as contents of the shell scripts are :
i3-msg 'workspace 1; append_layout i3.json'
i3-msg 'exec /usr/bin/chromium-browser'
i3-msg 'exec /usr/bin/dbeaver'
i3-msg 'exec /snap/bin/pycharm-community'
i3-msg 'exec /usr/bin/nautilus'
i3-msg 'exec /usr/bin/gnome-terminal'
i3-msg 'exec /usr/bin/chromium-browser'
awk -F' ' '{print $2}'If its bunch of characters, we can use :
awk -F'[.:]' '{print $2}'
awk -F'[[:space:].]+' '{print $2}'
[[:blank:][:cntrl:]]
[ \t,:;]
pip install pandas
python -m pip install pandas --proxy proxy..com:3128
import sys
!{sys.executable} -m pip install numpy
!{sys.executable} -m pip list --user
tmux
- Open terminal and type
Alsamixer
- After that select the sound card (usually PCH)
- Go to far right until optiona
Auto-mute mode
- press up arrow to make it disabled.
worked like a charm for me.sudo apt-get install rlwrap
rlwrap sqlite3 database.db
harsshal@dell:~$ ll /sys/class/backlight/
lrwxrwxrwx 1 root root 0 Mar 18 12:58 acpi_video0 -> ../../devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/lrwxrwxrwx 1 root root 0 Mar 18 12:58 intel_backlight -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/
harsshal@dell:~$ ll /sys/class/backlight/*/max_brightness -r--r--r-- 1 root root 4096 Mar 18 12:58 /sys/class/backlight/acpi_video0/max_brightness-r--r--r-- 1 root root 4096 Mar 18 12:58 /sys/class/backlight/intel_backlight/max_brightness
harsshal@dell:~$ cat /sys/class/backlight/*/max_brightness 7255000
harsshal@dell:~$ echo 7 | sudo tee /sys/class/backlight/acpi_video0/brightness 7
harsshal@dell:~$ xbacklight -set 60
harsshal@dell:~$ xrandr -q | grep -w connectedLVDS-1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 290mm x 180mmharsshal@dell:~$ xrandr --output LVDS-1 --brightness 1
set WshShell = WScript.CreateObject("WScript.Shell") x = 1 do while x = 1 'Loop forever and ever and ever and ever WshShell.SendKeys "%^" 'SEND CTL + ALT WScript.Sleep 290000 '<5 MINS loopI placed this script at location
C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
vim ~/.gnome2/nautilus-scripts/terminalFor nemo, we need to have scripts at following locations:
/usr/share/nemo/actions/
for system-wide actions$HOME/.local/share/nemo/actions/
for user actionsgnome-terminalAnd make that script executable:
chmod a+x ~/.gnome2/nautilus-scripts/terminal
usb-creator-gtkon my previous installation of linux mint.
sudo cp /usr/share/ca-certificates/mozilla/* /opt/Citrix/ICAClient/keystore/cacertsOne issue is chrome does not open citrix application right away. I need to open it via command line by executable located at
/opt/Citrix/ICAClient/wfica
$catsetup.py
from cx_Freeze import setup, Executable build_exe_options = { "includes": ['numpy', 'pandas','matplotlib.backends.backend_qt4agg'], "packages": [], "excludes": ['tk','ttk','zmq','boto','tkinter','_gtkagg', '_tkagg', 'bsddb', 'curses', 'pywin.debugger','pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl', 'Tkconstants', 'Tkinter'], "include_files": []} setup( name = "appName", version = "0.1", description = "", author = "Dengar", options = {"build_exe": build_exe_options}, executables = [Executable("sectorize.py")] )#python setup.py build
Went to link and started edited this file
[17:43:43 harsshal@lenovo:~]$ ll /opt/Citrix/ICAClient/config/All_Regions.ini
lrwxrwxrwx 1 root root 37 Nov 8 2013 /opt/Citrix/ICAClient/config/All_Regions.ini -> /etc/icaclient/config/All_Regions.ini
[17:44:08 harsshal@lenovo:~]$ sudo vim /etc/icaclient/config/All_Regions.ini
[Virtual Channels\Keyboard]
TransparentKeyPassthrough=Remote
# -*- coding: utf-8 -*- """ Created on Wed Apr 8 13:08:15 2015 @author: hpatil Solution to problem : http://code.google.com/codejam/contest/3214486/dashboard """ lit = [ #['abcdefg'] '1111110', '0110000', '1101101', '1111001', '0110011', '1011011', '1011111', '1110000', '1111111', '1111011' ] def display_calci(string): if(string=="ERROR!"): print(string) else: display = list(" ") print(''.join(display)) # line 1 if(string[5] =='1'): display[0]='|' if(string[0] =='1'): display[1]='^' if(string[6] =='1'): display[2]='_' if(string[1] =='1'): display[3]='|' display[4]='\n' if(string[4] =='1'): display[5]='|' if(string[3] =='1'): display[6]='_' display[7]='_' if(string[2] =='1'): display[8]='|' print(''.join(display)) def isDigitFeasible(active, disp_digit, digit): for led in range(7): if(active[led]=='1'): if( disp_digit[led] != lit[digit][led]): return 0 return 1 def get_active_leds(active, disp_digits): active= list(active) count = int(disp_digits[0]) for digit in range(1,count+1): for led in range(len(disp_digits[digit])): if(disp_digits[digit][led]=='1' ): active[led]='1' return ''.join(active) def led_unused(active, disp_digits, possible_digit): not_used = list('1111111') active= list(active) count = int(disp_digits[0]) for digit in range(1,count+1): possible_digit= (possible_digit+1)%10 for led in range(len(lit[possible_digit])): if(lit[possible_digit][led]=='1' ): not_used[led]='0' return ''.join(not_used) def print_digit(active, disp_digits, digit): result_string = "" unused = led_unused(active, disp_digits, digit) for led in range(len(active)): if(active[led]=='1'): result_string += lit[digit][led] else: if(lit[digit][led] == '1'): if(unused[led]=='1'): return "ERROR!" else: result_string += '0' else: result_string += '0' return result_string def get_possible_digits(active, disp_digit, possible): possible_return = [ ] for digit in possible: if(isDigitFeasible(active, disp_digit, digit)): possible_return.append(digit) return possible_return def solver(disp_digits): active= list('0000000') active = get_active_leds(active,disp_digits) if(debug): display_calci(active) count = int(disp_digits[0]) possible = [9,8,7,6,5,4,3,2,1,0] for digit in range(1,count+1): possible = get_possible_digits(active,disp_digits[digit], possible) possible = list(map(lambda x: (x-1) % 10, possible)) if(debug): print(possible) possible_soln = list(map(lambda x: print_digit(active,disp_digits,x), possible)) if(debug): print(possible_soln) soln_set = set(possible_soln) if(len(soln_set) != 1): return "ERROR!" else: return list(soln_set)[0] def read_input(): with sys.stdin as file: nTests = int(file.readline()) for tests in range (1, nTests+1): print("Case #" + str(tests)+": ", end="") disp_digits = file.readline().split('\n')[0].split(' ') if(debug): print(disp_digits[1:]) list(map(lambda x: display_calci(x), disp_digits[1:])) print("-----------") answer_string = solver(disp_digits) if(debug): display_calci(answer_string) print(answer_string) import sys debug = int(sys.argv[1]) sys.stdin = open (sys.argv[2]) #sys.stdin = open ('input2') #sys.stdin = open ('A-small-practice.in') #sys.stdin = open ('A-large-practice.in') read_input()
[01:35:11 harsshal@dell:~]$ cat /etc/udev/rules.d/90-keyboardwakeup.rules
#idVendor and idProduct taken from 'lsusb'
SUBSYSTEM=="usb", ATTRS{idVendor}=="0461", ATTRS{idProduct}=="4d15" RUN+="/bin/sh -c 'echo enabled > /sys$env{DEVPATH}/../power/wakeup'"
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", ATTRS{idProduct}=="2002" RUN+="/bin/sh -c 'echo enabled > /sys$env{DEVPATH}/../power/wakeup'"
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", ATTRS{idProduct}=="1002" RUN+="/bin/sh -c 'echo enabled > /sys$env{DEVPATH}/../power/wakeup'"
set meta-flag on
set input-meta on
set convert-meta off
set output-meta on
"\e[1~": beginning-of-line # Home key
"\e[4~": end-of-line # End key
"\e[5~": beginning-of-history # PageUp key
"\e[6~": end-of-history # PageDown key
"\e[3~": delete-char # Delete key
"\e[2~": quoted-insert # Insert key
"\eOD": backward-word # Ctrl + Left Arrow key
"\eOC": forward-word # Ctrl + Right Arrow key
$ cat ~/Dropbox/new_installation/scripts/flash_vid.sh
#!/bin/bash
num=1;
for FILE in $(lsof -n | grep "Flash.*deleted" | awk '{printf "/proc/" $2 "/fd/"; sub(/[a-z]+/,"",$4); print $4}'); do
cp $FILE $HOME/Desktop/$num.flv
size=$( stat -c %s $HOME/Desktop/$num.flv);
if [ $size -gt 5000000 ]; then
num=$[$num + 1];
else
rm $HOME/Desktop/$num.flv;
fi
done
insert into table1 select * deom database2.table2;
But they are not on the same host you can use following :
$ mysqldump -h host_name -u user_name -p database table_name "--where= date = 20111121" > temp
We can use "-t" option which will exclude table creation definition from the output.
$ find . -exec stat \{} --printf="%y %n\n" \; | sort -n -r | head -1
$ for i in `ls`; do echo -n $i" "; find $i -exec stat \{} --printf="%y %n\n" \; | sort -n -r | head -1;done
select now();
select curdate();
select curtime();
select date from table;
select date+0 from table;
select col from .... group by col with rollup;
Shell "*" => mysql "%"
Shell "?" => mysql "_"
select (sum(case when shares>0 then shares else - end) from table;
select 'A' like 'a';
1
select 'A' like binary 'a';
0
set @total=0;select (@total := 2+@total) as total from table;
select table_schema "Database name", sum(data_length _ index_length)/1024/1024 "size", sum (data_free)/1024/1024 "Free space " from information_schema.TABLES group by table_schema;
bash# mysql -e "select * from table";
mysql> select * into outfile "/tmp/hpatil" from ...;
SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;
PATH=$PATH:.:~/hpatil/0/
export EDITOR=/usr/bin/vim
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"'
PS1="[\t \u@\h:\w]$ "
export HISTSIZE=10000
export HISTCONTROL=erasedups
shopt -s histappend
BC_ENV_ARGS=~/.bcrc
export BC_ENV_ARGS
export INPUTRC=~/.inputrc
#alias vim="vim -c 'set nopaste'"
alias ll="ls -l"
alias rl="readlink -f"
alias vim='vim -c"set nopaste" '
alias vr='vim -MR -c"set nopaste" '
alias li='less -niFX'
alias grep_dir='_(){ bd;grep -a "mt=j" app.$1.tlog | grep -av "not active" | li;}; _'
OPTIONS="--timeout=86400"
sudo apt-get install wine
sudo apt-get install cabextract
wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-2.99.0.1.tar.gz
tar xzvf ies4linux-2.99.0.1.tar.gz
./ies4linux-2.99.0.1/ies4linux
ln /root/bin/ie6 /usr/bin/ie6
ie6
browser.link.open_newwindow
cat >> /etc/hal/fdi/policy/shmconfig.fdi << END
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
<match key="input.x11_driver" string="synaptics">
<merge key="input.x11_options.SHMConfig" type="string">True</merge>
</match>
</device>
</deviceinfo>
END
syndaemon -i 1 -d
du -s * | sort -k 1 -rn
du -s .* | sort -k 1 -rn
df -h
:%s/^V^M//g
:%s/^M//g
wget http://fahhem.com/pidgin/gtalkinvisible.tar.gz
tar -vxf gtalkinvisible.tar.gz
mv gtalkinvisible/gtalkinvisible.so ~/.purple/plugins/
rm -rf gtalkinvisible*
echo "ibase=16; obase=A; FACE" | bc
gpg -c pwd.txt
gpg pwd.txt.gpg
echo 0 >/selinux/enforce
vim /etc/selinux/config
cat >> ~/Dropbox/new_installation/wallpaper/mast/wall.sh << END
folder="Dropbox/new_installation/wallpaper/mast/"
rm -f ~/$folder/*.jpg
limit=`wc -l < ~/$folder/list`
my_number=`expr $RANDOM % $limit`
name=`tail -n $my_number ~/$folder/list| head -n 1`
wget -O ~/$folder/pics_list http://www.wallpaperbox.com/Celebrities/$name/
limit=`wc -l < ~/$folder/pics_list`
limit=`expr $limit - 10`
limit=`expr $limit / 2`
my_number=`expr $RANDOM % $limit`
echo $my_number
wget -O ~/$folder/$name.jpg http://www.wallpaperbox.com/Celebrities/$name/$name-$my_number.JPG
gconftool-2 -t str --set /desktop/gnome/background/picture_filename ~/$folder/$name.jpg
END
#!/bin/bash
#folder=`pwd`;
folder="/root/Dropbox/new_installation/wallpaper/celeb";
cd $folder;
rm -f *.jpg;
limit=`wc -l < list`;
my_number=`expr $RANDOM % $limit`;
name=`tail -n $my_number list| head -n 1`;
wget -O pics_list http://www.wallpaperbox.com/Celebrities/$name/ ;
limit=`wc -l < pics_list`;
limit=`expr $limit - 10`;
limit=`expr $limit / 2`;
my_number=`expr $RANDOM % $limit`;
wget -O $name.jpg http://www.wallpaperbox.com/Celebrities/$name/$name-$my_number.JPG;
gconftool-2 -t str --set /desktop/gnome/background/picture_filename $folder/$name.jpg;
vim /etc/NetworkManager/nm-system-settings.conf
managed=true
under [ifupdown]
vim /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 dhcp
reboot
wget -O - -q icanhazip.com
/**************************/
/* Different all twisty a */
/* of in maze are you, */
/* passages little. */
/**************************/
__ _,--="=--,_ __
/ \." .-. "./ \
/ ,/ _ : : _ \/` \
\ `| /o\ :_: /o\ |\__/
`-'| :="~` _ `~"=: |
\` (_) `/
.-"-. \ | / .-"-.
.---{ }--| /,.-'-.,\ |--{ }---.
) (_)_)_) \_/`~-===-~`\_/ (_(_(_) (
( qwe )
) asd (
( zxc )
) (
'---------------------------------------'
yum/apt-get install boxes
# dropbox start -i
wget http://www.getdropbox.com/download?plat=lnx.x86
wget http://www.getdropbox.com/download?plat=lnx.x86_64
tar zxof dropbox-*.tar.gz
mv .dropbox-dist ~/.dropbox-dist
wget http://dl.getdropbox.com/u/6995/dbmakefakelib.py
wget http://dl.getdropbox.com/u/6995/dbreadconfig.py
python dbmakefakelib.py
python dbreadconfig.py
cat >> ~/.bash_profile << END
~/.dropbox-dist/dropboxd &
END
"-------------------------------------
" always show this custom status line
set notitle " to avoid vim renaming the title of the xterm window
set nonumber " we don't need line numbers on the left, because we have status line
set laststatus=2 " always show the status line
set statusline=%<%F%h%m%r%h%w%y\ %{&ff}\ %{strftime(\"%c\",getftime(expand(\"%:p\")))}%=\ col:%c%V\ line:%l\,%L\ %P
" -------------------------------------
" use 2-space indentation
" set tabstop=2 " read :help tab for explanation of tabstop, softtabstop, shiftwidth
" set softtabstop=2 "
set shiftwidth=2 "
" set expandtab " inserts spaces instead of tab (for real tab use ctrl-V - tab)
" -------------------------------------
set showmatch " When a bracket is inserted, briefly jump to the matching one if it is visible on the screen.
set matchtime=3
" -------------------------------------
" set autoindent
" set smartindent
" set paste " you can set paste temporarily, but be aware that it interferes with autoindent
" it turns it off (and many other settings). Read :help paste
" -------------------------------------
set incsearch " search incremental
set ignorecase " search case-insensitive
set smartcase " search case-insensitive for small chars, case-sensitive if at least 1 capital char
set nohlsearch " search highlighting
" -------------------------------------
" This only works if you have plugin under .vim in home dir
" or if you include here a command to source plugin, for example:
" source ~lselector/lselector/.vim/plugin/taglist.vim
:map :TlistToggle
let Tlist_Exit_OnlyWindow = 1
" -------------------------------------
set ignorecase
set smartcase
set incsearch
set title
set wrap
set wildmenu
set noautoindent smartindent
set hlsearch
set paste
set ic
set softtabstop=2
set shiftwidth=2
set tabstop=2
set expandtab
match ErrorMsg '\%>80v.\+'
match
nnoremap :set invpaste paste?
set pastetoggle=
set showmode
nnoremap :set nowrap!
"set wrap!=
"set showmode
":set mouse=a
":map
":map
":map
":map
:map
:map
noremap :call ToggleMouse()
function! ToggleMouse()
if &mouse == 'a'
set mouse=
else
set mouse=a
endif
endfunction
if match($TERMCAP, 'Co#256:') == 0 || match($TERMCAP, ':Co#256:') > 0
set t_Co=256
endif
command -nargs=1 T2 :2match Search //
2nd paragraph is for not putting tab as /t ( instead, put it as 2 spaces).
rename XXX YYY *_vXXX.sh
rename XXX YYY ?_vXXX.sh
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stabl
yum install kmod-ndiswrapper
mkdir ~/new_installation/ndiswrapper_driver
cd ~/new_installation/ndiswrapper_driver
wget http://www.jbg.f2s.com/bcm43.bz2
tar jxvf bcm43.bz2
cd bcmwl5\ driver
ndiswrapper -i bcmwl5.inf
modprobe ndiswrapper
ndiswrapper -ma
yum -y groupinstall "X Window System" "GNOME Desktop Environment"
diff -ay file1 file2 | less
yum install httpd
ln -s /directory_to_share /var/www/directory_to_share
chmod 777 /directory_to_share
service httpd restart
[root@euclid ~]# virsh list
Id Name State
----------------------------------
4 veuler running
[root@gauss ~]# virsh list
Id Name State
----------------------------------
[root@euclid ~]# virsh migrate --live veuler qemu+ssh://gauss/system
root@gauss's password: *****
[root@euclid ~]# virsh list
Id Name State
----------------------------------
[root@gauss ~]# virsh list
Id Name State
----------------------------------
4 veuler running
losetup -f
losetup /dev/loop0 harshal.qcow
kaprtx -av /dev/loop0
vgscan
vgchange -ay vg_harshal
lvdisplay
mount /dev/vg_harshal/root1 /mount_point
umount /mount_point
vgchange -an vg_harshal
kpartx -dv /dev/loop0
losetup -d /dev/loop0
# ps -aux | grep firefox
#
cd ~/.mozilla/firefox/[profile_name]
rm lock .parentlock
ifconfig eth0 'new_ip' netmask 255.255.255.0 up
cat >> /etc/sysconfig/network << END
GATEWAY='Gateway_IP'
END
yum -y install ypserv
domainname SCRC
cat >> /etc/yp.conf << END
ypserver 127.0.0.1
END
cat >> /etc/sysconfig/network << END
NISDOMAIN=SCRC
END
service ypserv start
chkconfig ypserv on
/usr/lib/yp/ypinit -m
service ypbind start
chkconfig ypbind on
service ypxfrd start
chkconfig ypxfrd on
cd /var/yp
make
yum -y install ypbind
domainname SCRC
cat >> /etc/yp.conf << END
ypserver pioneer
END
cat >> /etc/sysconfig/network << END
NISDOMAIN=SCRC
END
service ypbind start
chkconfig ypbind on
svn checkout http://fileextensiontype.unfuddle.com/svn/fileextensiontype_fi/ local_directory_name
svn status
svn add *
svn commit
export EDITOR=vim
yum install xbindkeys
yum install xclip
xbindkeys --defaults > ~/.xbindkeysrc
xbindkeys -k
cat <<- END
"gnome-dictionary $(xclip -o)"
m:0x1c + c:52
END
echo "xbindkeys &" >> ~/.bashrc
killall -HUP xbindkeys
find . -name '*.c' > cscope.files
cscope -i cscope.files
cd /path/to/your/project
ctags -R *
vim -t
egrep 'vmx|svm' /proc/cpuinfo
yum install kvm kmod-kvm qemu
modprobe kvm-intel
modprobe kvm-amd
lsmod | grep kvm
ls -l /dev/kvm
mount server:/nfs_share /mount_point
wget -O /mount_point/fedora.iso http://mirror.cc.vt.edu/pub/fedora/linux/releases/10/Fedora/i386/iso/Fedora-10-i386-DVD.iso
qemu-img create fedoraroot.img -f raw 10G
export DISPLAY=your_machine:0.0
xhost +
qemu-kvm -m 512 -cdrom fedora.iso -boot d fedoraroot.img
qemu-kvm -m 512 fedoraroot.img
rm -f ~/wallpaper/w.jpg ~/wallpaper/widescreen_rss.php
wget -O ~/wallpaper/widescreen_rss.php http://www.mlewallpapers.com/widescreen_rss.php
wget -O ~/wallpaper/w.jpg `grep enclosure ~/wallpaper/widescreen_rss.php | cut -d \" -f 2`
gconftool-2 -t str --set /desktop/gnome/background/picture_filename ~/wallpaper/w.jpg
mkdir -p ~/new_installation/wallpaper
cat > ~/new_installation/wallpaper/wallpaper_changer.sh << END
rm -f ~/new_installation/wallpaper/w.jpg ~/new_installation/wallpaper/widescreen_rss.php
wget -O ~/new_installation/wallpaper/widescreen_rss.php http://www.mlewallpapers.com/widescreen_rss.php
wget -O ~/new_installation/wallpaper/w.jpg \`grep enclosure ~/new_installation/wallpaper/widescreen_rss.php | cut -d \" -f 2\`
gconftool-2 -t str --set /desktop/gnome/background/picture_filename ~/new_installation/wallpaper/w.jpg
END
chmod a+x ~/new_installation/wallpaper/wallpaper_changer.sh
cat >> /etc/sudoers << END
# crontab root scripts
action-owl ALL=(ALL) NOPASSWD:~/new_installation/wallpaper/wallpaper_changer.sh
END
cat >> /var/spool/cron/root << END
0 12 * * * ~/new_installation/wallpaper/wallpaper_changer.sh >/dev/null 2>&1
END
cat >> /var/spool/cron/crontabs/root << END
0 12 * * * ~/new_installation/wallpaper/wallpaper_changer.sh >/dev/null 2>&1
END
This will change wallpaper on 12 noon every day.
wget -O flash.tar.gz http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.22.87.linux-x86_64.so.tar.gz
tar xvzf flash.tar.gz
mkdir -p ~/.mozilla/plugins
mv libflashplayer.so ~/.mozilla/plugins
pkill firefox
firefox
echo gnome-terminal > ~/.gnome2/nautilus-scripts/terminal
chmod a+x ~/.gnome2/nautilus-scripts/terminal
mplayer -playlist http://asx.abacast.com/arabian_radio-city-64.asx -loop 0
mplayer - playlist http://www.1.fm/TuneIn/WM/energybbfm128k/Listen.aspx -loop 0
mplayer mmsh://citadelcc-wplj-fm.wm.llnwd.net/citadelcc_WPLJ_FM?MSWMExt=.asf
#!/bin/sh
while [ 1 ]
do
sp-sc $1 3908 8908 > /dev/null &
mplayer http://localhost:8908/tv.asf
done
pkill sp-sc
./sop sop://broker1.sopcast.com:3912/10912
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub | ssh office-user@office-comp "cat >> ~/.ssh/authorized_keys"
chmod 750 ~
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
/proc/sys/dev/cdrom/autoclose
/proc/sys/dev/cdrom/autoeject
/proc/sys/dev/cdrom/check_media
/proc/sys/dev/cdrom/debug
/proc/sys/dev/cdrom/info
/proc/sys/dev/cdrom/lock
openssl x509 -in getrootcert.cer -inform d -out verisign.pem
Here are some LaTeX resources that I've found useful:
1. Open the Buddy List.
2. In the menu, Tools->Plugins. Enable XMMP Console. Close the Plugin Window
3. In the menu again, Tools->XMMP Console->XMMP Console.
(See if your account in which you want to go invisible is selected if you have multiple accounts. )
4. In the text box, put the following XML snippet
{{{
<presence>
<priority>5</priority>
</presence>
<presence type="unavailable">
<priority>5</priority>
</presence>
}}}
Finally, if you want to reset the above settings. Follow the same procedure but make < presence type="available" > in the above XML snippet.