Skip to content

Instantly share code, notes, and snippets.

@ScottHelme
ScottHelme / lists.txt
Created January 13, 2021 10:57
My Pi-hole blocklist list.
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts https://mirror1.malwaredomains.com/files/justdomains http://sysctl.org/cameleon/hosts https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt https://hosts-file.net/ad_servers.txt https://v.firebog.net/hosts/AdguardDNS.txt https://adaway.org/hosts.txt https://v.firebog.net/hosts/Easyprivacy.txt https://v.firebog.net/hosts/Prigent-Ads.txt https://zerodot1.gitlab.io/CoinBlockerLists/hosts https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt https://raw.githubusercontent.com/ScottHelme/revocation-endpoints/master/ocsp.txt https://raw.githubusercontent.com/ScottHelme/revocation-endpoints/master/crl.txt https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts https://www.malwaredomainlist.c
@kndt84
kndt84 / monitor
Created June 22, 2020 12:15
VLC Player RTMP auto play with Raspberry Pi
#/bin/bash
PROG="VLC_STARTER"
IP=""
ID=""
PASS=""
export DISPLAY=:0
if [ "$1" = "" ]; then
echo "Usage: $0 [RGB|THERMO] boot"
exit 1
fi
@Jbithell
Jbithell / Westminster Parties.json
Last active May 20, 2017 18:40
Parties of the Houses of Parliament in the UK
{
"Con":{
"colour":"#0087DC",
"name" : "Conservative and Unionist Party",
"wikidescription" : "A party loosely divided into three categories: The Thatcherites or Conservative Way Forward, who strongly support a free market and tend to be Eurosceptic; the economically moderate, often more pro-European but socially conservative One Nation Conservatives; and the socially conservative, deeply Eurosceptic Cornerstone Group."
},
"Lab":{
"colour":"#DC241F",
"name" : "Labour Party",
"wikidescription" : "A big tent party historically allied with the trade union movement; based upon mixed market Third Way policies since the party was reinvented as New Labour in 1994. As a big tent party, it includes a range of views including New Labour, Socialists such as those belonging to the Socialist Campaign Group, and Social Democrats."
@Jbithell
Jbithell / iframe.html
Created September 11, 2016 19:24
Full page iframe
<!DOCTYPE html>
<html>
<head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
<meta content='width=device-width, initial-scale=1.0' name='viewport'>
<title></title>
<style>
html {
overflow: auto;
}
@Jbithell
Jbithell / welshubuntu.bash
Created September 4, 2016 14:57
Welsh Language support on ubuntu
sudo locale-gen cy_GB
sudo locale-gen cy_GB.UTF-8
sudo update-locale
locale -a
@avafloww
avafloww / PhpJava.java
Last active June 13, 2024 07:36
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@Jbithell
Jbithell / snapshotmyself.sh
Last active July 9, 2016 09:54
A system for snapshotting a droplet itself on DO
#!/bin/bash
#THIS SCRIPT MUST BE RUN AS ROOT
token=""
dropletid=""
dumpmysqlpass="password" #Set this to what you set in the setup!
cd /
mysqldump -u dump -p $dumpmysqlpass --all-databases > /databasebackup.sql #Dump the MySQL
doctl compute droplet-action snapshot $dropletid --wait --snapshot-name "Regular Auto Snapshot whilst running." -t $token #Run the snapshot
@aembleton
aembleton / docx2md.md
Last active May 17, 2023 07:04 — forked from vdavez/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@Geczy
Geczy / sso_login_freshdesk.php
Created December 4, 2012 22:16
SSO Login for Freshdesk support portal - PHP Sample Code
function freshdesk_login_url($name, $email) {
$secret = '____Place your Single Sign On Shared Secret here_____';
$base = 'http://mycompany.freshdesk.me/';
return $base . "login/sso/?name=" . urlencode($name) . "&email=" . urlencode($email) . "&hash=" . hash('md5', $name . $email . $secret);
}
header("Location: " . freshdesk_login_url("John Doe", "username@thecompany.com") );
#!/usr/bin/python
import sys #for cmd line argv
#take command line args as the input string
input_string = sys.argv
#remove the program name from the argv list
input_string.pop(0)
#convert to google friendly url (with + replacing spaces)