Skip to content

Instantly share code, notes, and snippets.

View lebowitz's full-sized avatar

Craig Lebowitz lebowitz

  • Bonterra
  • Washington, DC
View GitHub Profile
#!/bin/sh
USERNAME="cal"
if test -z $1
then
echo "you must specify a hostname or ip address as the first argument"
exit 1
fi
key=`cat ~/.ssh/id_dsa.pub`
ssh $USERNAME@$1 "mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo \"$key\" >> ~/.ssh/authorized_keys && chmod 644 ~/.ssh/authorized_keys"
if [ $? = "0" ]; then
#!/bin/sh
echo ">>>> Shell Copy >>>>"
echo ""
HOST=$1
BIN=`which scp`
if test -z $HOST
then
echo "You must specify a hostname or ip address as the first argument"
exit 1
fi
@lebowitz
lebowitz / es.sh
Last active December 20, 2015 01:09 — forked from AVVS/es.sh
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless curl -y
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.2.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@lebowitz
lebowitz / backup.sh
Last active August 29, 2015 13:57 — forked from karussell/backup.sh
# TO_FOLDER=/something
# FROM=/your-es-installation
DATE=`date +%Y-%m-%d_%H-%M`
TO=$TO_FOLDER/$DATE/
echo "rsync from $FROM to $TO"
# the first times rsync can take a bit long - do not disable flusing
rsync -a $FROM $TO
# now disable flushing and do one manual flushing
#get root access
$su -
$ cd /tmp
#Remove old Ruby
$ yum remove ruby
# Install dependencies
$ yum groupinstall "Development Tools"
$ yum install zlib zlib-devel

Keybase proof

I hereby claim:

  • I am lebowitz on github.
  • I am lebowitz (https://keybase.io/lebowitz) on keybase.
  • I have a public key whose fingerprint is 53DA F35A F717 2CF9 2061 171A F08F 2CC2 E867 13BF

To claim this, I am signing this object:

@lebowitz
lebowitz / logstash.bat
Created December 8, 2015 14:30
General purpose logstash bootstrap
set LS_OPTS="-v "
set CLASSPATH=%~dp0\sqljdbc42.jar
set JAVA_HOME=C:\Program Files (x86)\Java\jre1.8.0_66
..\logstash-1.5.4\bin\logstash agent --verbose -f "%~dp0\logstash.conf"
@lebowitz
lebowitz / Jenkins444Rental.md
Last active May 20, 2017 15:59
Jenkins Row Unit 444 Rental Ad

1391 PENNSYLVANIA AVE SE UNIT 444

Contact Emily at 410-533-6182 or eas628@gmail.com

Available July 1. $2,300/month rent.

Location

Capitol Hill at the corner of Pennsylvania Ave and Potomac Ave, SE. Across the street from Potomac Ave Metro Station on the Blue, Orange, and Silver lines. Two station stops from the US Capitol.

@lebowitz
lebowitz / find_sql.ps1
Created June 28, 2023 18:28
Find Sql Servers On A Network
$nets = ('10.10.10.0/24');
foreach($subnet in $nets) {
$fn = "$($subnet.Replace('/','_')).txt"
c:\installs\nmap\nmap.exe $subnet -p T:1433 --min-parallelism 4 -Pn -oG $fn | Out-Null
gc $fn | select-string open
}
# DONE
# 10.11.75.0/24
# 10.10.2.14/24