# mkdir /mnt/sdb1
# mount /dev/sdb1 /mnt/sdb1
# cd /
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
/root/bin/socks_tunnel | |
#!/bin/bash | |
trap "stop" SIGTERM SIGINT | |
if [[ -z $1 ]]; then | |
echo 'Please, specify server...' | |
exit 1 | |
fi |
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
-- | |
-- Change database owner | |
-- | |
ALTER DATABASE "db_name" OWNER TO user; | |
-- | |
-- List schemas | |
-- |
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 | |
### BEGIN INIT INFO | |
# Provides: vino-server | |
# Required-Start: $local_fs | |
# Required-Stop: $local_fs | |
# Should-Start: | |
# Should-Stop: | |
# X-Start-Before: | |
# X-Stop-After: |
Tested on Ubuntu 16.04 Docker container. The Dockerfile is a single line FROM ubuntu:16.04
.
NOTE: stopping services didn't work for me for some reason. That's why there is pidof <service name> | xargs kill
after each failed service <service name> stop
to kill it.
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
# One liner | |
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
# Explained | |
wget \ | |
--recursive \ # Download the whole site. | |
--page-requisites \ # Get all assets/elements (CSS/JS/images). | |
--adjust-extension \ # Save files with .html on the end. | |
--span-hosts \ # Include necessary assets from offsite as well. | |
--convert-links \ # Update links to still work in the static version. |
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
// This code will automatically save the current canvas as a .png file. | |
// Its useful as it can be placed in a loop to grab multiple canvas frames, I use it to create thumbnail gifs for my blog | |
// Only seems to work with Chrome | |
// Get the canvas | |
var canvas = document.getElementById("canvas"); | |
// Convert the canvas to data | |
var image = canvas.toDataURL(); | |
// Create a link | |
var aDownloadLink = document.createElement('a'); |
Short how-to for creating a reverse ssh tunnel to a remote server. Useful for breaking NATted connection for example.
- At OpenWrt:
opkg update
opkg install sshtunnel
- At remote server: create client ssh keys
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 requests | |
import base64 | |
from tqdm import tqdm | |
master_json_url = 'https://178skyfiregce-a.akamaihd.net/exp=1474107106~acl=%2F142089577%2F%2A~hmac=0d9becc441fc5385462d53bf59cf019c0184690862f49b414e9a2f1c5bafbe0d/142089577/video/426274424,426274425,426274423,426274422/master.json?base64_init=1' | |
base_url = master_json_url[:master_json_url.rfind('/', 0, -26) + 1] | |
resp = requests.get(master_json_url) | |
content = resp.json() |
NewerOlder