Sometimes you find yourself catching up with some devs who did not care to add all the stuff they should to SVN or you want to make sure all files are in SVN. Well here’s a hand script : svn status | awk ‘{if ($1 == “?”) print $2 }’ | xargs svn add nJoy…
Category: Uncategorized
Running node.js in production.
Node.js is my new love !! In one of my latest projects I needed to set up a RESTFUL web service which in a nutshell would be a simple interface / API to a bunch of functions based tightly on the HTML standard commands GET, PUT, DELETE, etc.. I decided to go with a language…
Disabling IPv6, breaks SSH X11 Forwarding in Linux CENTOS and UBUNTU all versions
This was a weird one. It took me ages to discover why SSH X11 died at some point after tuning a box. It so happens that disabling IPv6 ( not used on my networks) is assumed in SSH at some point and if you disable it (which many people say is a way to avoid…
Creating a sha512 from a salt and a cleartext in BASH (using pthon)
Simple one-liner $>python -c ‘import hashlib; print hashlib.sha512(“1234123123”).hexdigest(); ‘ can be easily packaged in a bash script. nJoy;-)
Using Puttygen to create a ssh key and passwordless login with putty to Centos.
The ssh password-less login works in a simple way. Though sometime people find it confusing. The basics: > Client side has a private key pointed to by > Server side has the public key of the client. On your client box create a public and private key set using (for putty) puttygen. (In linux all…
Quick tool to test if ssh port is accessible using nc
for i in {1..2000} ;do if nc -z ec2-xxx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com 22 ;then echo YEP ; else echo NOPE ; fi ; sleep 1 ; done nJoy 😉
Controlling windows system from a Linux box.
Set up winexe. wget "ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/GRNET:/synnefo/CentOS_CentOS-6/x86_64/winexe-1.00-9.1.x86_64.rpm" yum install winexe-1.00-9.1.x86_64.rpm Test the connection <pre>telnet 10.0.0.123 139</pre> Now we can try the system out winexe -U "User 1" –password=secretpassword //10.0.0.123 'cmd /C "whoami"' If you get : ERROR: Failed to open connection – ERRDOS:ERRnomem then it’s probably a Windows 7 box run reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management"…
Execution sequence for interactive login shell scripts
./etc/profile if ~/.bash_profile exists then execute ~/.bash_profile else if ~/.bash_login exists then execute ~/.bash_login else if ~/.profile exists then execute ~/.profile fi ~/.bashrc is not used in interactive scripts. nJoy 😉
Installing latest ImageMagick on Ubuntu 12.04
So … At time of writing Latest version can be found here : http://www.imagemagick.org/script/download.php wget “http://www.imagemagick.org/download/ImageMagick-6.8.6-9.tar.gz” sudo apt-get install build-essential checkinstall && sudo apt-get build-dep imagemagick tar xzvf ImageMagick-* cd ImageMagick-6.8.6-9 ./configure –prefix=/opt/imagemagick-6.8 && make
How to allow includes, Basic Auth from outside .htaccess
This .htaccess file does the following: Allow SSI lines 1/2/3 Reauire Authenitcation for all outside except those from a particular IP the rest .. Options +Includes AddType text/html .shtml .html AddOutputFilter INCLUDES .shtml .html AuthType Basic AuthName “Password Required For INGG Monitor” AuthUserFile /var/www/passwords/password.file Require valid-user Order deny,allow Deny from all Allow…