This file contains hidden or 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 sh | |
set -x # Be verbose | |
set -u # Exit if unbound variables | |
FILE="/home/user/bigfile.iso" | |
DEST="gdrive_user" | |
DIR="test" | |
while true; do |
This file contains hidden or 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/perl | |
use strict; | |
use Cwd; | |
use File::Find; | |
my $dir = $ARGV[0] || $ENV{PWD}; | |
chdir($dir); | |
my $dir= getcwd(); | |
print "$dir\n"; |
This file contains hidden or 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 python2.7 | |
# -*- coding: utf8 -*- | |
import time | |
import random | |
import socket | |
def main(): | |
dic = {} | |
for i in range(1,10): | |
dic['key_'+str(i)] = random.randint(1, 100000) |
This file contains hidden or 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/perl | |
use strict; | |
use warnings; | |
use JSON; | |
use LWP::UserAgent; | |
use HTTP::Request::Common; | |
use HTTP::Cookies; | |
use Term::ANSIColor qw(:constants); |
This file contains hidden or 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
# plugin_exec.conf | |
LoadPlugin exec | |
<Plugin exec> | |
Exec "user" "/opt/collectd/etc/metrics/grep_stuff.sh" | |
</Plugin> | |
# grep_stuff.sh | |
HOSTNAME="${COLLECTD_HOSTNAME:-localhost}" | |
INTERVAL="${COLLECTD_INTERVAL:-60}" |
This file contains hidden or 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 | |
# We can set our CN using it as an argument | |
[ -n "$1" ] && CN=$1 || CN=localhost | |
# RSA params | |
RSA=2048 | |
DAYS=365 | |
# subj Params |
This file contains hidden or 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 | |
# wdial wrapper for 3G orange modems | |
set +o posix | |
ok() { echo -ne "\e[32m#\n#\t$1\n#\e[m\n"; } | |
nk() { echo -ne "\e[31m#\n#\t$1\n#\e[m\n"; exit 1; } | |
[ -c /dev/ttyHS0 ] && [ -c /dev/ttyHS1 ] && { | |
USB1=/dev/ttyHS3 # Globetrotter HSUPA Modem (aka icon 451) | |
USB2=/dev/ttyHS3 | |
PIN= |
This file contains hidden or 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 python -u | |
# -*- coding: utf8 -*- | |
import json | |
import pycurl | |
from io import BytesIO | |
from urllib.parse import urlencode, urlparse | |
from influxdb import InfluxDBClient | |
# Configuration Defaults |
This file contains hidden or 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/python | |
# -*- coding: utf8 -*- | |
# http://graphite.readthedocs.io/en/latest/events.html | |
import time | |
import requests | |
host = "http://graphite/events/" | |
epoch = int(time.time()) |
This file contains hidden or 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/python | |
# -*- coding: utf8 -*- | |
import os | |
import json | |
import time | |
import requests | |
from requests.adapters import HTTPAdapter | |
OlderNewer