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
// http://drywa.me/2017/07/02/simple-win32-window-with-rust/ | |
#![windows_subsystem = "windows"] | |
extern crate winapi; | |
extern crate user32; | |
extern crate kernel32; | |
use std::ffi::OsStr; | |
use std::os::windows::ffi::OsStrExt; | |
use std::iter::once; |
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
# Install https://www.vaultproject.io/ | |
brew install vault | |
# Start dev vault server in a separate terminal | |
vault server -dev | |
# ==> Vault server configuration: | |
# ... | |
# Unseal Key: 7ACQHhLZY5ivzNzhMruX9kSa+VXCah3y87hl3dPSWFk= | |
# Root Token: 858a6658-682e-345a-e4c4-a6e14e6f7853 |
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
# pull the official mongo docker container | |
docker pull mongo | |
# create network | |
docker network create my-mongo-cluster | |
# create mongos | |
docker run -d --net my-mongo-cluster -p 27017:27017 --name mongo1 mongo mongod --replSet my-mongo-set --port 27017 | |
docker run -d --net my-mongo-cluster -p 27018:27018 --name mongo2 mongo mongod --replSet my-mongo-set --port 27018 | |
docker run -d --net my-mongo-cluster -p 27019:27019 --name mongo3 mongo mongod --replSet my-mongo-set --port 27019 |
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 | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
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
// create a bookmark and use this code as the URL, you can now toggle the css on/off | |
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3 | |
javascript: (function() { | |
var elements = document.body.getElementsByTagName('*'); | |
var items = []; | |
for (var i = 0; i < elements.length; i++) { | |
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) { | |
items.push(elements[i]); | |
} | |
} |
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
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands) | |
gpg --gen-key | |
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null` | |
# check current keys: | |
gpg --list-secret-keys --keyid-format LONG | |
# See your gpg public key: | |
gpg --armor --export YOUR_KEY_ID | |
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333) |
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
Usage: youtube-dl [OPTIONS] URL [URL...] | |
Options: | |
General Options: | |
-h, --help Print this help text and exit | |
--version Print program version and exit | |
-U, --update Update this program to latest version. Make | |
sure that you have sufficient permissions | |
(run with sudo if needed) | |
-i, --ignore-errors Continue on download errors, for example to |
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
All value pairs (f.ex rate and queue size) will be in the UP/DOWN | |
order. Use the up/down/left/right arrow keys to move between screens. | |
Usage: rtorrent [OPTIONS]... [FILE]... [URL]... | |
-h Display this very helpful text | |
-n Don't try to load ~/.rtorrent.rc on startup | |
-b <a.b.c.d> Bind the listening socket to this IP | |
-i <a.b.c.d> Change the IP that is sent to the tracker | |
-p <int>-<int> Set port range for incoming connections | |
-d <directory> Save torrents to this directory by default |
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 bash | |
for filename in *.mkv | |
do | |
echo $filename | |
# only keep the second subtitle track | |
mkvpropedit "$filename" --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1 | |
done |
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
youtube-dl Supported sites | |
Here's is the list of all the supported sites, ordered alphabetically: | |
1tv: Первый канал | |
1up.com | |
20min | |
220.ro | |
23video |
NewerOlder