First make your changes to nginx.conf.
Then run the following command to test the new configuration:
# nginx -t -c /etc/nginx/nginx.conf
2007/10/18 20:55:07 [info] 3125#0: the configuration file /etc/nginx/nginx.conf syntax is ok
2007/10/18 20:55:07 [info] 3125#0: the configuration file /etc/nginx/nginx.conf was tested successfully
Next, look for the process id of the master nginx process:
# ps -ef|grep nginx
root 1911 1 0 18:00 ? 00:00:00 nginx: master process /usr/sbin/nginx
www-data 1912 1911 0 18:00 ? 00:00:00 nginx: worker process
Lastly, tell nginx to reload the configuration and restart the worker processes:
# kill -HUP 1911
taken from:
http://snippets.aktagon.com/snippets/93-Change-nginx-configuration-on-the-fly
Saturday, February 13, 2010
Monday, February 1, 2010
bash one liner (essentially) to loop through list of files and upload using rsync
for f in `cat file-includes.txt`; do rsync -avz $f user@server.ip:/base-path/$f; done
you could also do the -e 'ssh -i /path/to/preshared/key' to avoid the rsync password prompt on each connect
for f in `cat file-includes.txt`; do rsync -avz -e 'ssh -i /path/to/preshared/key' $f user@server.ip:/base-path/$f; done
I find that this works better for only syncing a short list of files than trying to use the rsync switch --include-from=/path/to/file-includes.txt along with the --exclude-from=/path/to/file-excludes.txt or the --exclude=*
for some reason i couldnt get it to exclude everything BUT what was in my includes-from txt file.
Here is an even more expanded version that creates the white list of files for you containing all visible files in the current directory. You will probably want to modify it so that it only includes a subset of that. Otherwise it is pretty pointless (because it just does what rsync normally does uploads all changed files). You can hand create your white list of files to upload or use svn commit messages even.
ls -1 ./ > ./file-includes.txt; for file in `cat ./file-includes.txt`; do rsync -avz -e 'ssh -i /path/to/preshared/key' $( readlink -f "$( dirname "$file" )" )/$( basename "$file" ) user@server.ip:/base-path/$( readlink -f "$( dirname "$file" )" )/$( basename "$file" ); done; rm ./file-includes.txt
you could also do the -e 'ssh -i /path/to/preshared/key' to avoid the rsync password prompt on each connect
for f in `cat file-includes.txt`; do rsync -avz -e 'ssh -i /path/to/preshared/key' $f user@server.ip:/base-path/$f; done
I find that this works better for only syncing a short list of files than trying to use the rsync switch --include-from=/path/to/file-includes.txt along with the --exclude-from=/path/to/file-excludes.txt or the --exclude=*
for some reason i couldnt get it to exclude everything BUT what was in my includes-from txt file.
Here is an even more expanded version that creates the white list of files for you containing all visible files in the current directory. You will probably want to modify it so that it only includes a subset of that. Otherwise it is pretty pointless (because it just does what rsync normally does uploads all changed files). You can hand create your white list of files to upload or use svn commit messages even.
ls -1 ./ > ./file-includes.txt; for file in `cat ./file-includes.txt`; do rsync -avz -e 'ssh -i /path/to/preshared/key' $( readlink -f "$( dirname "$file" )" )/$( basename "$file" ) user@server.ip:/base-path/$( readlink -f "$( dirname "$file" )" )/$( basename "$file" ); done; rm ./file-includes.txt
Tuesday, January 19, 2010
mysqldump to comma delimited file
mysqldump -u username --password=pass -h hostip -t -T./ dbname tablename --fields-enclosed-by=\" --fields-terminated-by=,
Sunday, January 17, 2010
syntax reminder on how to send mail from the command line
I always forget the params for this stuff
mail -s "subject" -c "person.to.cc.to@blah.com another.person.to.cc.to@blah.com" person.for.to.address@blah.com < /path/to/message/contents/text/file.txt
mail -s "subject" -c "person.to.cc.to@blah.com another.person.to.cc.to@blah.com" person.for.to.address@blah.com < /path/to/message/contents/text/file.txt
Sunday, January 3, 2010
page up down in vi in mac os terminal
Move up or down in “vi” from Mac OS X terminal:
Then CTRL-B and CTRL-F should do the trick.
Then CTRL-B and CTRL-F should do the trick.
.vimrc settings
These are my current vim settings
let mysyntaxfile = "/Users/jessesanford/.vim/go.vim"
syntax on
set nu
set ai
set tabstop=4
set ruler
set laststatus=2
set showmode
set expandtab
let loaded_matchparen=1
let mysyntaxfile = "/Users/jessesanford/.vim/go.vim"
syntax on
set nu
set ai
set tabstop=4
set ruler
set laststatus=2
set showmode
set expandtab
let loaded_matchparen=1
Tuesday, December 22, 2009
How to execute remote bash commands using ssh
"...
ssh -t YOURHOST "bash --rcfile PATH_TO_RCFILE_ON_REMOTE_HOST_HOME_DIR_SHORTCUTS_WORK_FOR_AUTHED_USER"
bash will be executed on the remote host, and bash will execute the specfied RCFILE at startup, and connection will remain open. -t is to have the current terminal forwarded to the ssh session so that you have a real terminal.
You can have some variant on the same kind, still use ssh -t. Like if screen is installed, you can do:
ssh -t YOURHOST screen
..."
Alternative:
"...
ssh YOURHOST bash --rcfile YOUR_RC_FILE -i
But then you don't have a real terminal, and some stuff will not work correctly (like tab auto-completion).
..."
from:
http://www.linuxforums.org/forum/linux-networking/102713-how-execute-remote-shell-commands-via-ssh.html
ssh -t YOURHOST "bash --rcfile PATH_TO_RCFILE_ON_REMOTE_HOST_HOME_DIR_SHORTCUTS_WORK_FOR_AUTHED_USER"
bash will be executed on the remote host, and bash will execute the specfied RCFILE at startup, and connection will remain open. -t is to have the current terminal forwarded to the ssh session so that you have a real terminal.
You can have some variant on the same kind, still use ssh -t. Like if screen is installed, you can do:
ssh -t YOURHOST screen
..."
Alternative:
"...
ssh YOURHOST bash --rcfile YOUR_RC_FILE -i
But then you don't have a real terminal, and some stuff will not work correctly (like tab auto-completion).
..."
from:
http://www.linuxforums.org/forum/linux-networking/102713-how-execute-remote-shell-commands-via-ssh.html
Subscribe to:
Posts (Atom)
