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 | |
# Setup OVH VM guest networking on Ubuntu 22.04 | |
# Change hostname | |
read -p "Enter new fully-qualified domain name: " fqdn | |
hostname=${fqdn%%.*} | |
echo "Changing FQDN to $fqdn, hostname to $hostname" | |
sudo hostnamectl set-hostname $hostname | |
sudo sed -i "s/\(^127\.0\.1\.1.*$\)/127.0.1.1\t$fqdn $hostname/g" /etc/hosts |
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 python3 | |
""" | |
Scroll to the bottom and change your IP address (if running the script from another host), Surveillance Station account and password, | |
the camera name and presets. It shouldn't be too hard to add some other cameras and presets if you know a bit of programming. | |
Add a task in DSM Task Scheduler to execute this file every minute. | |
In case you want to extend this script further to do other stuff, the complete documentation for the Surveillance Station Web API can be found at: | |
https://global.download.synology.com/download/Document/DeveloperGuide/Surveillance_Station_Web_API_v2.8.pdf |
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 python | |
# Send more accurate memory readings from Mac OS X than the default plugin | |
# Calculations from: http://badrit.com/blog/2014/5/1/how-to-calc-memory-usage-in-mavericks-programmatically | |
import collectd | |
import subprocess | |
import re | |
PAGE_SIZE = 4096 # From the top of `vm_stat` |
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
git clone git://github.com/sivel/speedtest-cli.git speedtest-cli |
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
git clone git://github.com/sivel/speedtest-cli.git speedtest-cli |
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
Show hidden characters
{ | |
"font_size": 14, | |
"rulers": | |
[ | |
80 | |
], | |
"scroll_past_end": true, | |
"indent_to_bracket": true, | |
"tab_size": 4, |
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
[ | |
{ "keys": ["control+super+left"], "command": "jump_back" }, | |
{ "keys": ["control+super+right"], "command": "jump_forward" }, | |
{ "keys": ["shift+super+o"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }, | |
{ "keys": ["control+shift+l"], "command": "expand_selection", "args": {"to": "line"} }, | |
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} }, | |
] |
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 | |
# Opens up DiffMerge comparing a local version of the file (base) with a modified version | |
# on a remote machine. Assumes that the directory structure is the same after "cache | |
# directory" configuration value. | |
# Configuration values | |
LOCALCACHEDIR="/var/repo/cache/" | |
REMOTECACHEDIR="/home/remoteuser/repo/cache/" | |
REMOTESERVERNAME="staging" |
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
[user] | |
name = Dennis Tsang | |
email = [email protected] | |
[color] | |
ui = true | |
[alias] | |
st = status | |
ci = commit | |
br = branch |