Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash -e
# /opt/scripts/svn-cat-tag-versions.sh
# @author: Nestor Urquiza
# @date: 20140319
USAGE="Usage: `basename $0` <tag_base_url> <file_path> <version_from> <version_to>"
if [ $# -ne "4" ]
then
echo $USAGE
#!/bin/bash -e
# nbsp2sp.sh
filePath=$1
USAGE="Usage: `basename $0` &lt;filePath&gt;"
if [ $# -ne "1" ]
then
echo $USAGE
@nestoru
nestoru / gist:9960727
Created April 3, 2014 19:02
Set execution bit for file in git repo
git update-index --chmod=+x *.sh
git commit -m "setting execution bit"
git push
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
/**
* @author Nestor Urquiza
* @date 20140409
*
#!/bin/bash -e
# installGetHttpStatusCode.sh
# @author: Nestor Urquiza
# @date: 20140409
USAGE="Usage: `basename $0` <baseInstallationPath>"
baseInstallationPath=$1
if [ $# -ne "1" ]
curl -O https://gist.githubusercontent.com/nestoru/10284218/raw/89a247253fe244ccde810a98c47070d71ae777ce/installGetHttpStatusCode.sh
chmod +x installGetHttpStatusCode.sh
#use your preferred directory for installation, in thos case /tmp
./installGetHttpStatusCode.sh /tmp
cd /tmp/http-test; java -cp ".:./httpcomponents-client-4.3.3/lib/*" GetHttpStatusCode https://github.com
#!/bin/bash -e
# runInHosts.sh
# @author: Nestor Urquiza
# @created: 20130712
USAGE="Usage: `basename $0` <clusterNodes[user@host space delimited list or a path to a file comntaining the list]> <command>"
if [ $# -ne "2" ]; then
echo $USAGE
# pure command line
$ ./runInHosts.sh "user@server1.sample.com user@server2.sample.com user@server3.sample.com user@server4.sample.com user@server5.sample.com" date
user@server5.sample.com: Fri Jul 12 11:45:02 EDT 2013
user@server2.sample.com: Fri Jul 12 11:45:02 EDT 2013
user@server4.sample.com: Fri Jul 12 11:45:02 EDT 2013
user@server3.sample.com: Fri Jul 12 11:45:02 EDT 2013
user@server1.sample.com: Fri Jul 12 11:45:02 EDT 2013
# using a file
$ cat hosts.txt
@nestoru
nestoru / gist:10289125
Created April 9, 2014 16:28
Ping multiple hosts from a file
echo yahoo.com > hosts
echo google.com >> hosts
for host in `cat hosts` do; ping $host; done
@nestoru
nestoru / find_talend_components_in_use.sh
Created April 13, 2014 13:57
Find Talend components in use from command line
# Change base_dir and job as needed
base_dir=/opt/talend
job=my_job
grep -o 'componentName="[^"]*' $base_dir/${job}/${job}/items/${job}/process/${job}*.item \
| sed 's/componentName="//g' | sort | uniq