Skip to content

Instantly share code, notes, and snippets.

View thefrenchmatt's full-sized avatar
👁️‍🗨️

Matt thefrenchmatt

👁️‍🗨️
View GitHub Profile
@danielfaust
danielfaust / samsung_remote.py
Created May 30, 2011 04:12
Samsung TV Remote Control Python Script
import time
import socket
import base64
src = '192.168.1.2' # ip of remote
mac = '00-AB-11-11-11-11' # mac of remote
remote = 'python remote' # remote name
dst = '192.168.1.3' # ip of tv
app = 'python' # iphone..iapp.samsung
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong
@mlb-
mlb- / bypass-quora-login.user.js
Created November 18, 2012 07:32 — forked from kaezarrex/massive-props.user.js
Bypass Quora's annoying login
// ==UserScript==
// @name Bypass Quora Login
// @namespace http://www.quora.com
// @include http://www.quora.com/*
// ==/UserScript==
var script = document.createElement('style');
script.innerHTML = '\
.modal_signup_background,.modal_signup_dialog,.modal_signup_top_section{\
display: none !important; \
@mfellner
mfellner / rsync-sshfs.sh
Created June 9, 2013 15:42
Sync a local and a remote directory with rsync over sshfs (e.g. when you only have sftp access). Note the defer_permissions option and the -c (checksum) flag. Tested on OS X with rsync 2.6.9 and sshfs 2.4.0 (fuse4x 0.9.2).
#!/bin/bash
SSH_USER="user@sftp.domain.com" # your sftp credentials
SSH_KEY="~/.ssh/id_rsa" # your ssh private key
DOCUMENT_ROOT="/www/vhosts/mywebsite.com/htdocs" # directory on the remote server
LOCAL_DIR="~/mywebsite.com/public" # directory on your local machine
REMOTE_DIR="_remote_dir" # temporary mount point
mkdir -p $REMOTE_DIR
sshfs $SSH_USER:$DOCUMENT_ROOT $REMOTE_DIR -o workaround=rename -o defer_permissions -o IdentityFile=$SSH_KEY
@goyalankit
goyalankit / bash_to_zsh_history.rb
Last active October 28, 2023 05:07
Import bash history to zsh history.
#################################################################
# = This script transfers bash history to zsh history
# = Change bash and zsh history files, if you don't use defaults
#
# = Usage: ruby bash_to_zsh_history.rb
#
# = Author: Ankit Goyal
#################################################################
# change if you don't use default values
@hluk
hluk / CopyQ - Frequent Items.ini
Last active March 11, 2018 23:48
CopyQ 2.3.0 user commands to add frequent items to special tab and to show frequent items
[Commands]
1\Name=Activate and Add to Frequent
1\Command="
copyq:
tab_name = \"Frequent\"
source = selectedtab()
tab(source)
items = selecteditems()
p = \"application/x-copyq-\"
@bradrydzewski
bradrydzewski / generate_docker_cert.sh
Last active May 27, 2024 15:59
Generate trusted CA certificates for running Docker with HTTPS
#!/bin/bash
#
# Generates client and server certificates used to enable HTTPS
# remote authentication to a Docker daemon.
#
# See http://docs.docker.com/articles/https/
#
# To start the Docker Daemon:
#
# sudo docker -d \
@sirkkalap
sirkkalap / Install-Docker-on-Linux-Mint.sh
Last active December 8, 2022 18:38
Install Docker on Linux Mint
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x
##########################################
# Check that HTTPS transport is available to APT
if [ ! -e /usr/lib/apt/methods/https ]; then
sudo apt-get update
sudo apt-get install -y apt-transport-https
fi
@Manouchehri
Manouchehri / cloudflare.sh
Last active June 14, 2024 00:55
Allow CloudFlare only
# Source:
# https://www.cloudflare.com/ips
# https://support.cloudflare.com/hc/en-us/articles/200169166-How-do-I-whitelist-CloudFlare-s-IP-addresses-in-iptables-
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
for i in `curl https://www.cloudflare.com/ips-v6`; do ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
# Avoid racking up billing/attacks
# WARNING: If you get attacked and CloudFlare drops you, your site(s) will be unreachable.
iptables -A INPUT -p tcp -m multiport --dports http,https -j DROP
@amercier
amercier / synology-scheduled-tasks.md
Last active January 10, 2024 08:31
Turn leds on/off on Synology DiskStation

Synology scheduled tasks

Usage

Go to Control Panel / Task Scheduler and add the content of these scripts as root scripts.

Leds