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 | |
# stig@stigok.com Oct 2019 | |
# | |
# Reference: | |
# http://positon.org/a-solution-to-the-umask-problem-inotify-to-force-permissions | |
set -x | |
# Take the directory name as argument | |
inotifywait -mrq -e CREATE --format %w%f "$1" | while read FILE | |
do |
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 | |
# Backs up a complete mongodb database instance running on localhost and | |
# uploads a gzipped dump to an S3 bucket (in this case Scaleway Object Storage) | |
# | |
# Configure s3cmd with `s3cmd --configure` | |
set -eu | |
MONGODB_USER=${MONGODB_USER} | |
MONGODB_PASSWORD=${MONGODB_PASSWORD} |
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
function look4luv (find, the, love, and, u, will, know) { | |
if (--I <3) return | |
the = find ? find.document : u || will || know || the || love | |
love = '<3' | |
find = (u || know || the || love) | |
u = undefined | |
u ? | |
will : | |
(find || the).title = the.title.endsWith(love) ? the.title.substr(0, the.title.length - love.length) : the.title + |
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
angular.module('ngApp') | |
.directive('soundCloudPlayer', function () { | |
return { | |
restrict: 'E', | |
template: '<iframe width="100%" height="465" scrolling="no" frameborder="no"></iframe>', | |
link: function (scope, element, attrs) { | |
var iframe = element.find('iframe'); | |
var settings = [ | |
'buying=false', | |
'liking=false', |
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 brightness of intel backlight | |
# Usage: | |
# setbrightness | |
# Print current brightness | |
# setbrightness <level> | |
# Set brightness to <level> 1-10 | |
# setbrightness less | |
# Set brightness to current level - 1 |
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 - | |
# | |
# Install OpenVPN connections for all available | |
# regions to NetworkManager | |
# | |
# Important: | |
# This is a modified version of the official Ubuntu script PrivateInternetAccess.com | |
# released at https://www.privateinternetaccess.com/installer/install_ubuntu.sh | |
# Automatic installation of python and openvpn has been removed, and needs to be | |
# installed manually before installation. |
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
$ tf plan | |
Refreshing Terraform state in-memory prior to plan... | |
The refreshed state will be used to calculate this plan, but will not be | |
persisted to local or remote state storage. | |
kubernetes_namespace.default: Refreshing state... (ID: tkp-test) | |
kubernetes_stateful_set.ingestor: Refreshing state... (ID: tkp-test/pingers) | |
------------------------------------------------------------------------ |
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
import queue | |
import threading | |
import sys | |
class ThreadedQueue: | |
def __init__(self, task, timeout=10): | |
self.threads = dict() | |
self.queues = dict() | |
self.task = task | |
self.timeout = timeout |
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
def test(): | |
print("Test method") | |
if __name__ == "__main__": | |
print("Main method") |
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
# Set screen brightness | |
# Usage: setbrightness more|less|<int> | |
DIR="/sys/class/backlight/intel_backlight" | |
MAX_VALUE=$( < $DIR/max_brightness ) | |
MAX_STEP=${MAX_STEP:-8} | |
STEP_AMOUNT=$(( $MAX_VALUE / $MAX_STEP )) | |
CURRENT_VALUE=$( < $DIR/brightness ) | |
CURRENT_STEP=$(( $CURRENT_VALUE / $STEP_AMOUNT )) |