Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/bin/sh | |
token="$1" | |
if [ -z "$token" ]; then | |
read token | |
fi | |
echo $token | sed -e "s/-/+/" -e "s/_/\//" | base64 -d | xmllint --format --recover - | |
echo |
{"NAME":"AITHINKER CAM inc LEDs","GPIO":[4992,1,1,1,416,5088,1,1,1,1,1,1,1,1,5089,5090,0,5091,5184,5152,0,5120,5024,5056,0,0,0,0,4928,320,5094,5095,5092,0,0,5093],"FLAG":0,"BASE":1} |
#!/bin/sh | |
token="$1" | |
if [ -z "$token" ]; then | |
read token | |
fi | |
echo $token | jq -R 'gsub("-";"+") | gsub("_";"/") | split(".") | select(length > 0) | .[0],.[1] | @base64d | fromjson' | |
echo |
const fs = require('fs'); | |
const replace = [ | |
// fix spaces after @, # and () | |
[/@ %s/g, '@%s'], | |
[/@% s/g, '@%s'], | |
[/`@ %s '/g, '`%s`'], | |
[/"@ %s/g, '"@%s'], |
#!/bin/bash | |
# Adjust homserver, room, and accesstoken to your particular setup | |
# Script is expecting data to be piped in on STDIN | |
# Example: | |
# echo "some text" | sendmatrix | |
msgtype=m.text | |
homeserver=<homeserver> | |
room=<room id> |
#!/usr/bin/env python3 | |
import socket | |
hostname = socket.gethostname() | |
import subprocess | |
import time | |
def print_influx_data(xendomain, item, value): | |
global timestamp | |
print('xen_' + item + ',domain=' + xendomain + ',host=' + hostname + ' ' + value + ' ' + timestamp) |
#!/usr/bin/env python | |
# Script to query Dell's API for the hardware's original config. | |
# Just drop your service tag as parameters for the script and go. | |
import sys | |
import requests | |
APIKEY = 'd676cf6e1e0ceb8fd14e8cb69acd812d' | |
URL = 'https://api.dell.com/support/v2/assetinfo/detail/tags.json?svctags={0}&apikey=' + APIKEY |
TODO : | |
- manage user notification ; notify-send not really working ; current alternative either. | |
- display hostid used to customize usb backup script. | |
INSTALL | |
- copy usb-auto-backup script to /usr/local/bin, | |
- create an partition on an USB drive named "backup" ; get id (/dev/sddX) -> will be needed in udev.rules | |
- identity your drive information for UDEV-rules using : udevadm info -a -p $(udevadm info -q path -n /dev/sdXX) | |
- create an UDEV rule : /etc/udev/rules.d/99-usb-auto-backup.rules like this one : |
#!/usr/bin/env bash | |
cd /tmp | |
# Install dependencies | |
aptitude -y install build-essential python-pip libmysqlclient-dev libadns1-dev \ | |
python-dev libreadline-dev libgdbm-dev zlib1g-dev libsqlite3-dev \ | |
libssl-dev libbz2-dev libncurses5-dev libdb-dev | |
# Download latest version |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000