Tikejhya: Ashish Nepal

Knowledgebase

Month: June 2014 (Page 1 of 2)

NFS howto

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Server

yum install nfs-utils nfs-utils-lib
chkconfig nfs on
service rpcbind start
service nfs start

vi /etc/exports
/ home 12.33.44.555(rw,sync,no_root_squash,no_subtree_check)

exportfs -a

client
……….
yum install nfs-utils nfs-utils-lib
mkdir -p /mnt/nfs/home
mount 12.34.56.789:/home /mnt/nfs/home

You can ensure that the mount is always active by adding the directory to the fstab file on the client. This will ensure that the mount starts up after the server reboots.
vi /etc/fstab

12.34.56.789:/home /mnt/nfs/home nfs auto,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800 0 0

curl with –data

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

curl -s -A “Ashish /1.0 (Linux; Centos 1.1.1; TK-LOL Build/10000)” –data “username=tikejhya” –data “password=mypass” –location “http://ashishnepal.com/login”

bat script to turn off thunderbird chat

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

@ECHO OFF
C:WINDOWSsystem32findstr “Profiles” “%APPDATA%Thunderbirdprofiles.ini” > “%APPDATA%Thunderbirdtemp.ini”
set /p DUSER=<“%APPDATA%Thunderbirdtemp.ini”
FOR /F “tokens=2 delims=/” %G IN (“%DUSER%”) DO ECHO %G>”%APPDATA%Thunderbirdtemp.ini”
set /p DUSER=<“%APPDATA%Thunderbirdtemp.ini”
echo user_pref(“mail.chat.enabled”, false); >> “%APPDATA%ThunderbirdProfiles%DUSER%prefs.js”

mail command with from address

echo “no-reply” | mail  -r no-reply@test.com -s “something” tikejhya@hotmail.com

# Setting reply to address
export REPLYTO=tikejhya@hotmail.com; echo “This is the main body of the mail” | mail -s “Subject of the Email” -r tikejhya@hotmail.com tikejhya@hotmail.com

SVN Master slave

comming soon…

how to test memcached object from commandline or telnet

echo -e ‘get cache_objectn’; sleep 3 | telnet 192.168.1.1 11211 | grep -i VALUE

 

Memcached Tips:

Telnet to your server:

telnet 127.0.0.1 11211

List the items, to get the slab ids:

stats items
STAT items:3:number 1
STAT items:3:age 498
STAT items:22:number 1
STAT items:22:age 498
END
The first number after ‘items’ is the slab id. Request a cache dump for each slab id, with a limit for the max number of keys to dump:

stats cachedump 3 100
ITEM views.decorators.cache.cache_header..cc7d9 [6 b; 1256056128 s]
END

stats cachedump 22 100
ITEM views.decorators.cache.cache_page..8427e [7736 b; 1256056128 s]
END

‘show full processlist’ in postgres?

SELECT * from pg_stat_activity;

screen session on non root user

postgres@ip-10-73-209-228:~$ ps
PID TTY TIME CMD
31309 pts/3 00:00:00 bash
31338 pts/3 00:00:00 ps

root@ip-10-73-209-228:~# ls -al /dev/pts/4
crw——- 1 root tty 136, 4 Jun 9 16:17 /dev/pts/4
root@ip-10-73-209-228:~# chown postgres /dev/pts/4
root@ip-10-73-209-228:~# ls -al /dev/pts/4
crw——- 1 postgres tty 136, 4 Jun 9 16:17 /dev/pts/4
root@ip-10-73-209-228:~#

 

now you will be able to run screen.

xdebug proxy

wget http://downloads.activestate.com/Komodo/releases/8.5.1/remotedebugging/Komodo-PythonRemoteDebugging-8.5.1-82367-linux-x86_64.tar.gz
mv Komodo-PythonRemoteDebugging-8.5.3-83298-linux-x86_64 xdebug-proxy
yum install python-setuptools python-pip

# If yum doesnot find python-pip you can download rpm for your required bit.
# Install

# e.g. rpm -Uvh python-pip-1.3.1-4.el6.noarch.rpm

pip install dbgp

cd /to/path/of/ur/extract

# create a screen session or nohub ……… &
./pydbgpproxy-i [ip-of-proxy]:9001-d :9000

cygwin cronjob

run cygwin as administrator and run :

cygrunsrv -I cron -p /usr/sbin/cron -a -D

or

configure using: cron-config

 

 

Page 1 of 2

Powered by WordPress & Theme by Anders Norén