Skip to content

Instantly share code, notes, and snippets.

"""
Example of use of inotify. Extracted from django.utils.autoreload
"""
import pyinotify
def inotify_logs_changed():
class EventHandler(pyinotify.ProcessEvent):
def process_default(self, event):
@bvcelari
bvcelari / README.md
Created August 4, 2016 18:04 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index:

$ root@ip-LALALALALA:/salt# salt '*' mine.update network.ip_addrs
minion-1:
True
minion-2:
True
------------------------
$ root@ip-LALALALALA:/salt# salt '*' pillar.get network.ip_addrs
minion-1:
@bvcelari
bvcelari / rebaseabranch.sh
Created November 8, 2017 11:32
git how to rebase
git checkout origin/Branch-Name-to-rebase
git log #check that master code is there
git branch #check that there is a detached branch there
git checkout -b Branch-Name-to-rebase
git branch #check that you are in your branch now
git log #check that your commits are there
git rebase master #rebase
git log #check that your commits are there.. just after the last from master
git push origin Branch-Name-to-rebase #try to push nicely....
git push --force origin Branch-Name-to-rebase #and.. force if it doesn't work
#pre-requisites...
apt-get install -y openssh-server vim git virtualenv
#####required for docker states... should not be needed, but there is something broken in the salt repo...
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
#Rust Version
if [ "$0" != "" ]; then
RUST_VERSION=$0
else
RUST_VERSION="stable"
fi
#Parity Version
if [ "$1" != "" ]; then
PARITY_VERSION=$1
#pre-requisites...
apt-get install -y openssh-server vim git virtualenv
#####required for docker states... should not be needed, but there is something broken in the salt repo...
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
#Script has one input paramerter, folder where are the top and jstack files
#Script will get all the content from PATH, look for files with topdashHOutput name, check the CPU_USAGE_COLUMN and when the value is higher than HIGH_CPU will chck in the jstak files for the Hex code
import rlcompleter, readline
import sys
import subprocess
print 'Searching in ... :'+ sys.argv[1]
readline.parse_and_bind('tab:complete')
PATH = sys.argv[1]
def all = [ Jenkins.instance ]
all.addAll(Jenkins.instance.nodes)
all.each {
def c = it.toComputer()
println "[$it.nodeName] - $it.numExecutors - $it.assignedLabels - $it.acceptingTasks - $it.nodeProperties - $c.offline"
}
println "----"
Jenkins.instance.queue.items.each {
println "$it.id $it.blocked $it.buildable $it.stuck $it.assignedLabel $it.causes"
}
#Set Env
JENKINS_SOURCE=http://localhost:9999
JENKINS_DESTINATION=http://localhost:8888
SOURCE_FOLDER=Fancy_SourceFolder
DESTINATION_FOLDER=Fancy_DestinationFolder
TEMP_FOLDER=Store_tmp_folder