This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# crontab -e | |
# */10 * * * * DISPLAY=:0.0 ${HOME}/bin/battery.sh | |
NOW=`echo $((100*$(sed -n "s/remaining capacity: *\(.*\) m[AW]h/\1/p" /proc/acpi/battery/BAT0/state)/$(sed -n "s/last full capacity: *\(.*\) m[AW]h/\1/p" /proc/acpi/battery/BAT0/info)))` | |
THRESHOLD="30" | |
if [ $NOW -lt $THRESHOLD ]; | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "deploying ${PROJECT}-${VERSION}.zip" | |
JOB_URL="http://jenkins.devops.com.ar/job/Push_Artifactory" | |
JOB_STATUS_URL="${JOB_URL}/lastBuild/api/json" | |
GREP_RETURN_CODE=0 | |
# Start the build | |
JENKINS_USER=jenkins-frontend | |
API_TOKEN=c**85ffcc***13abc397 | |
curl --user $JENKINS_USER:$API_TOKEN "$JOB_URL/buildWithParameters?env=${STAGE}&repo=${PROJECT}&revision=${VERSION}" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dependencies for deluge | |
yum install python-mako pyOpenSSL python-chardet python-setuptools python-simplejson python-twisted-web pyxdg | |
# dependencies for rb_libtorrent | |
sudo yum install GeoIP boost-filesystem boost-thread boost-system boost-python | |
cat >rpm-files.txt<<EOF | |
http://pkgrepo.linuxtech.net/el6/release/noarch/deluge-web-1.3.5-1.el6.noarch.rpm | |
http://pkgrepo.linuxtech.net/el6/release/noarch/deluge-images-1.3.5-1.el6.noarch.rpm | |
http://pkgrepo.linuxtech.net/el6/release/noarch/deluge-console-1.3.5-1.el6.noarch.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BRANCH=master | |
REPO=ansi-projects | |
USER=otsuarez | |
CMD_GITLOG='cd /usr/local/src/$REPO; git log | head -n1 | cut -f2 -d" "' | |
URL=https://api.github.com/repos/$USER/$REPO/git/refs/heads | |
github=`curl -s -H 'Accept: application/vnd.github.preview' -H "Authorization: token pc540face14f95acfc0089e53bfhck72a48s8c19" ${URL}/${BRANCH} -L | grep sha | sed 's/.* "\(.*\)",$/\1/'` | |
server1=`ssh server1 ${CMD_GITLOG}` | |
server2=`ssh server2 ${CMD_GITLOG}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ ! -d "~/bin" ]; then mkdir ~/bin ; fi | |
if [ ! -d "~/backups" ]; then mkdir ~/backups ; fi | |
cat >bin/backup-scripts.sh<<'EOF' | |
#!/bin/bash | |
DATE=`date +%Y%m%d_%H%M` | |
HOST=`hostname` | |
BASE_DIR=/usr/local/src | |
DIR=ansi-projects | |
FILE=$DIR-$HOST-$DATE.tgz | |
cd $BASE_DIR/$DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# # http://jenkins.example.com/job/Deploy_Pkg/ | |
if [ ! -d ${REPO_HOME}/${ENV} ]; | |
then | |
mkdir -p ${REPO_HOME} | |
fi | |
pwd | |
ls -alR | |
echo "environment:" | |
echo $ENV | |
echo "jenkins home: ${JENKINS_HOME} " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATE=$(shell date +%Y%m%d) | |
DBNAME="acmedb" | |
all: dump | |
dump: | |
sudo service mysql restart | |
ssh server1 ssh server2 /home/sysop/bin/backup-db.sh | |
ssh server1 rm -f /var/tmp/$DBNAME-full.sql.gz | |
ssh server1 scp server2:/var/tmp/$DBNAME-full.sql.gz /var/tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### new-package.coffee | |
``` | |
# Description: | |
# watch for new artifacts and triggers deployment | |
# | |
# Dependencies: | |
# None | |
# | |
# Commands: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sessionname asciinema | |
screen -t rails 0 bash -c 'source ~/.rvm/scripts/rvm ; rvm use 2.1.1 ; cd ~/src/github/asciinema.org ; bundle exec rails server' | |
screen -t sidekiq 1 bash -c 'source ~/.rvm/scripts/rvm ; rvm use 2.1.1 ; cd ~/src/github/asciinema.org ; bundle exec sidekiq' | |
detach |
OlderNewer