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
# Done successfully on a Toshiba THNSNJ512GCSY | |
# WARNING: ALL DATA ON THE DRIVE WILL BE LOST; DON'T DO THIS UNLESS YOU KNOW ITS WHAT YOU NEED | |
# This is a series of shell commands, not a functional script | |
# Once unlocked, the drive should be able to be initialized/MBR written and partitions created. | |
sudo -s | |
# Identify drives | |
lsblk |
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 | |
token="$1" | |
if [ -z "$token" ]; then | |
read token | |
fi | |
echo $token | sed -e "s/-/+/" -e "s/_/\//" | base64 -d | xmllint --format --recover - | |
echo |
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
{"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} |
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 | |
token="$1" | |
if [ -z "$token" ]; then | |
read token | |
fi | |
echo $token | jq -R 'gsub("-";"+") | gsub("_";"/") | split(".") | select(length > 0) | .[0],.[1] | @base64d | fromjson' | |
echo |
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
import codecs | |
import re | |
from os import listdir | |
from os.path import isfile, join, dirname, abspath, basename | |
from typing import Any, Optional, Set, Dict | |
import sys | |
import black | |
from jinja2 import Template | |
import jinja2 |
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
const fs = require('fs'); | |
const replace = [ | |
// fix spaces after @, # and () | |
[/@ %s/g, '@%s'], | |
[/@% s/g, '@%s'], | |
[/`@ %s '/g, '`%s`'], | |
[/"@ %s/g, '"@%s'], |
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 | |
# 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> |
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 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) |
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 | |
# 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 |
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
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 : |
NewerOlder