Skip to content

Instantly share code, notes, and snippets.

View dalmosantos's full-sized avatar

Dalmo Santos dalmosantos

View GitHub Profile
@olleolleolle
olleolleolle / jslint_with_juicer.py
Created March 11, 2010 16:08
jslint.py: Here is my take on bash scripting: using Python's subprocess module.
#!/usr/bin/env python
import subprocess
import fnmatch
import os
import os.path
from string import Template
from optparse import OptionParser
import webbrowser
import string
import datetime
@textarcana
textarcana / git-log2json.sh
Last active June 19, 2024 10:55
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO: https://github.com/context-driven-testing-toolkit/git-log2json
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@chrisweibel
chrisweibel / jboss.plugin.zsh
Created February 29, 2012 23:32
jboss deployment script
# Simple JBoss7 helper functions
# set var to jboss home dir
JBOSS_HOME="/usr/local/jboss/jboss-as-web-7.0.2.Final"
#Start BBoss
alias jboss-start="sudo $JBOSS_HOME/bin/standalone.sh"
#Stop JBoss
alias jboss-stop="sudo $JBOSS_HOME/bin/jboss-admin.sh --connect command=:shutdown"
@avelino
avelino / gist:3188137
Created July 27, 2012 13:49
shell script, como colorir o retorno do seu código
echo -e " \033[0;30m Preto \033[0m --> 0;30 "
echo -e " \033[0;31m Vermelho \033[0m --> 0;31 "
echo -e " \033[0;32m Verde \033[0m --> 0;32 "
echo -e " \033[0;33m Marrom \033[0m --> 0;33 "
echo -e " \033[0;34m Azul \033[0m --> 0;34 "
echo -e " \033[0;35m Purple \033[0m --> 0;35 "
echo -e " \033[0;36m Cyan \033[0m --> 0;36 "
echo -e " \033[0;37m Cinza Claro \033[0m --> 0;37 "
echo -e " \033[1;30m Preto Acinzentado \033[0m --> 1;30 "
echo -e " \033[1;31m Vermelho Claro \033[0m --> 1;31 "
@steve-jansen
steve-jansen / git-diff-add
Last active September 19, 2018 21:37
A custom script for git to interactively run "git difftool" against each modified and untracked file, then prompt to stage (add) the change, undo (checkout) the change, or ignore (skip) the change.
#!/bin/bash
# query the root of the repo because git status prints
# relative paths within the repo
if ! pushd "`git rev-parse --show-toplevel`" >/dev/null
then
echo "git rev-parse --show-toplevel failed to return the root dir of the repo"
exit 1
else
gitroot=`pwd`
@sdesalas
sdesalas / restart-iis-remote.bat
Last active July 14, 2020 18:44
This script restarts IIS and configures it on a remote server. Needs Sysinternals PsExec (http://technet.microsoft.com/en-au/sysinternals/bb897553.aspx)
:: Stop IIS
PsExec.exe \\LDNSERV01 -s -i C:\windows\system32\inetsrv\appcmd.exe stop site OnlineXCart
:: Recycle App Pool (removes lock on file system)
PsExec.exe \\LDNSERV01 -s -i C:\windows\system32\inetsrv\appcmd.exe recycle apppool OnlineXCart
:: Wait 4 Seconds
:: This is useful if you have a command straight after that executes file operations on IIS App Directory
ping -n 5 127.0.0.1 > nul
@leocomelli
leocomelli / git.md
Last active June 20, 2024 20:51
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@micw
micw / install_jenkins_plugin.sh
Last active August 11, 2023 06:14
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins
@garystafford
garystafford / helpful-docker-commands.sh
Last active June 20, 2024 16:59
My list of helpful docker commands
###############################################################################
# Helpful Docker commands and code snippets
###############################################################################
### CONTAINERS ###
docker stop $(docker ps -a -q) #stop ALL containers
docker rm -f $(docker ps -a -q) # remove ALL containers
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter
# exec into container
@yuanying
yuanying / vagrant-kvm.md
Last active April 17, 2024 08:12
How to use vagrant-kvm

Install Vagrant

sudo su
apt-get update && apt-get install -y libvirt-dev ruby-all-dev apparmor-utils
curl -O -L https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb
dpkg -i vagrant_1.6.5_x86_64.deb 
aa-complain /usr/lib/libvirt/virt-aa-helper # workaround
exit

Install vagrant-kvm as user