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 | |
# Author: Aleksander Baranowski | |
# License: MIT (https://choosealicense.com/licenses/mit/) | |
# This simple script looks for changed .sh file from the last git commit | |
# then run shellcheck on them. | |
# USAGE: shellcheck_ci repo_root_dir | |
# Exit codes: | |
# 98 - required command is not installed | |
# 1 - some file failed check |
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
# Simple script that get UUIDs and remove virtualbox disk (hdds). | |
hdds=$(vboxmanage list hdds | grep '^UUID' | awk '{ print $2}') | |
for hd in $hdds; do vboxmanage closemedium disk $hd --delete; done |
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 bash | |
# Author: Alex Baranowski | |
# This is trivial backup script | |
# Backup should be done on **different** physical disk, and as any other file can be moved &&|| replicated. | |
# Stop on the first error | |
set -e | |
[[ -v "$KEEP_DAYS" ]] || KEEP_DAYS=120 |
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 bash | |
[ -z "$PGDATA" ] && echo "PGDATA is not defined!" && exit 1 | |
[ ! -e $PGDATA/postmaster.pid ] && echo "Cannot find $PGDATA/postmaster.pid is PostgreSQL server running?" && exit 1 | |
PG_PID=$(head -1 $PGDATA/postmaster.pid) | |
PG_MEM_U=$(grep ^VmPeak /proc/$PG_PID/status | awk '{print $3}') | |
HP_MEM_U=$(grep ^Hugepagesize /proc/meminfo | awk '{print $3}') | |
[ "$PG_MEM_U" != "$HP_MEM_U" ] && echo "The units differ please calculate the Huge Pages manually" && exit 1 | |
PG_MEM=$(grep ^VmPeak /proc/$PG_PID/status | awk '{print $2}') | |
HP_MEM=$(grep ^Hugepagesize /proc/meminfo | awk '{print $2}') |
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 | |
# The MIT License (MIT) | |
# Copyright (c) 2017 EuroLinux | |
# Author: Alex Baranowski | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
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 | |
diff requirements.txt requirements.txt2 | awk '{print $2}' | xargs pip uninstall -y |
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
with open('some_args') as f1: | |
with open('some_names') as f2: | |
with open('out', 'w') as f3: | |
args = f1.readlines() | |
name = f2.readlines() | |
print('lenghts :', len(args), len(name)) | |
for i in range(len(args)): | |
f3.write('(\'{}\', \'{}\'),\n'.format(args[i].strip(), name[i].strip())) |
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
; Mostly taken from http://jonls.dk/redshift/ | |
; Global settings for redshift | |
[redshift] | |
; Set the day and night screen temperatures | |
temp-day=5700 | |
temp-night=3200 | |
; Enable/Disable a smooth transition between day and night | |
; 0 will cause a direct change from day to night screen temperature. | |
; 1 will gradually increase or decrease the screen temperature. |
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
find . -name '*\.py' -exec grep '^import ' {} \; | sort | uniq > req |
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 | |
# | |
# name: TODO_NAME | |
# | |
# description:TODO_DESC | |
# default log file: /var/log/TODO_LOG | |
# | |
# Copyright 2016 TODO, Inc. | |
# TODO_NAME <TODO_MAIL> | |
# |