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
# '--port' option disables DNS | |
dnsmasq -d --interface eno1 --dhcp-range=10.0.0.100,10.0.0.105,255.255.255.0,6h --port=0 |
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
# dumb function to replace setuptools-scm in python packaging | |
get_version () { | |
if hash docker 2>/dev/null; then | |
git_version=$(docker run --rm -v $(pwd):/git alpine/git describe --tags --long) | |
else | |
git_version=$(git describe --tags --long) | |
fi | |
tag=$(echo ${git_version} | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') |
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/sh | |
# Script to fill RAM memory with writing zeroes to /dev/shm. | |
# Usage: | |
# ./fill_ram.sh <STEP> <THRESHOLD> | |
# <STEP>: filling step (%) | |
# <THRESHOLD>: used memory threshold (%) | |
# Example: | |
# ./fill_ram.sh 5 70 | |
# Fill RAM with 5% step and stop filling on 70% memory used. |
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 | |
# Add this script to crontab: | |
# * * * * * username suspend-when-lid-is-closed.sh | |
if grep -q closed /proc/acpi/button/lid/LID0/state; then | |
echo "lid is closed, suspending..." > /tmp/suspend-when-lid-is-closed.log | |
systemctl suspend | |
fi |
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
#!/usr/bin/env groovy | |
payload = """ | |
{ | |
"title": "Updating Toolchain", | |
"description": "Need to deploy new versions of toolchain after succesful build.", | |
"state": "OPEN", | |
"open": true, | |
"closed": false, | |
"fromRef": { |
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 | |
# set empty repo with enabled pre-revprop-change hook | |
# set first last revisions to dump and migrate | |
first_rev='1' | |
last_rev='15' | |
# range of revisions of old repo to migrate | |
revs="$(svn log -q -r$first_rev:$last_rev | grep -oE '^r[0-9]+' | tr -d 'r' | sort -n)" |
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 | |
project_name="my-project" | |
# Full path to your svn repo or path in repo | |
svn_repo="https://server.svn/repos/my-project" | |
trunk_path="/trunk" | |
tags_path="/tags" | |
branches_path="/branches" | |
default_email_suffix="@my.company" | |
git_repo="ssh://git@bitbucket.git:7999/my-project.git" |
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
#!/usr/bin/env groovy | |
def jenkins_cli = "/var/jenkins_home/war/WEB-INF/jenkins-cli.jar" | |
def jenkins_url = "http://127.0.0.1:8080/" | |
def admin_email = "admin@domain.com" | |
def credentials = "--username \"someuser\" --password \"somepass\"" | |
node { | |
properties( | |
[ |
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 | |
# LDAP-server | |
host="ldap.example.org" | |
# User for auth | |
user="CN=YourUser,CN=Users,DC=ldap,DC=example,DC=org" | |
# Password of User | |
pass="YourPass" | |
# LDAP base name | |
base_name="OU=WhereToSearch,DC=ldap,DC=example,DC=org" |
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
path="." | |
for link in $(find "$path" -type l); do | |
ln -f $(readlink -f $link) $link | |
done | |
echo "Converted hard links from symlinks:" | |
find "$path" -type f -printf '%n %p\n' | awk '$1 > 1{$1="";print}' |
NewerOlder