Skip to content

Instantly share code, notes, and snippets.

View Zeryther's full-sized avatar
🎯

Mehdi Baaboura Zeryther

🎯
View GitHub Profile
@LB--
LB-- / Minecraft-Name-History.php
Last active July 31, 2016 23:23
Minecraft Name History - http://www.LB-Stuff.com/Minecraft-Name-History - really hacky PHP script, available in public domain
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Minecraft Name History - Nicholas "LB" Braden</title>
<link rel="canonical" href="http://www.LB-Stuff.com/Minecraft-Name-History" />
<link rel="stylesheet" href="/light.css" />
<link rel="icon" type="image/png" href="/LB.png" />
<script src="https://apis.google.com/js/platform.js" async defer></script>
</head>
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active May 12, 2024 19:12
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@rendro
rendro / parsecookie.js
Last active May 4, 2024 15:38
Parse document.cookie into object
document.cookie.split(';').map(function(c) {
return c.trim().split('=').map(decodeURIComponent);
}).reduce(function(a, b) {
try {
a[b[0]] = JSON.parse(b[1]);
} catch (e) {
a[b[0]] = b[1];
}
return a;
}, {});
@parente
parente / postinstall.sh
Last active April 23, 2024 06:11
Post-install script to disable SSH password authentication, install latest Docker with AUFS on Ubuntu 14.04 VMs
#!/bin/bash
# Disable password authentication
sudo grep -q "ChallengeResponseAuthentication" /etc/ssh/sshd_config && sed -i "/^[^#]*ChallengeResponseAuthentication[[:space:]]yes.*/c\ChallengeResponseAuthentication no" /etc/ssh/sshd_config || echo "ChallengeResponseAuthentication no" >> /etc/ssh/sshd_config
sudo grep -q "^[^#]*PasswordAuthentication" /etc/ssh/sshd_config && sed -i "/^[^#]*PasswordAuthentication[[:space:]]yes/c\PasswordAuthentication no" /etc/ssh/sshd_config || echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
sudo service ssh restart
# Install latest Docker
sudo apt-get update
sudo apt-get -y install linux-image-extra-$(uname -r)
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
@Manouchehri
Manouchehri / cloudflare.sh
Last active May 15, 2024 02: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
@fasterthanlime
fasterthanlime / state-of-emergency-in-france.md
Last active March 26, 2021 21:29
What the state of emergency means in France, where it's been declared following the Paris attacks
@MaxKorlaar
MaxKorlaar / Bukkit.org credentials script.js
Last active August 8, 2016 17:06
This was the script that was used to steal passwords and usernames on bukkit.org, one of Curse's sites. Since they didn't disclose it at the time I wrote my blog post, I published it here for future reference.
function getXmlHttp() {
try {
return new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
return new ActiveXObject("Microsoft.XMLHTTP");
}
catch (ee) {
}
@eribeiro
eribeiro / gource-ffmpeg.sh
Last active February 11, 2022 16:23
Run Gource on a git repo, outputs as a movie (movie.mp4) and compresses it (output.mp4)
gource -s .06 -1280x720 --auto-skip-seconds .1 --multi-sampling --stop-at-end --key --highlight-users --hide mouse,progress,files,filenames,dirnames --file-idle-time 0 --max-files 0 --background-colour 000000 --font-size 22 --title "Lucene/Solr" --output-ppm-stream - --output-framerate 30 | avconv -y -r 30 -f image2pipe -vcodec ppm -i - -b 65536K movie.mp4
&& ffmpeg -i movie.mp4 -b:v 3048780 -vcodec libx264 -crf 24 output.mp4
@jomo
jomo / Minecraft Accounts.md
Last active April 16, 2024 21:57
Tracking down Minecraft account creation

Tracks down when a Minecraft account was created.

How it works

Mojang has an API endpoint for usernames:

https://api.mojang.com/users/profiles/minecraft/<name>?at=<timestamp>

It can be used to find the UUID of an account, by username it used at the given time.
It returns either 200 OK or 204 No Content – indicating that the username was not in use at the time.

@cscawley
cscawley / mc-server-status.html
Last active July 31, 2016 11:56
An example of a jQuery snip-it that calls mc-api.net and returns json, displaying the status of any minecraft server.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="status"></div>
<script src="http://code.jquery.com/jquery-2.2.0.min.js"></script>
<script>
(function() {
var minetoastStatus = "https://us.mc-api.net/v3/server/info/192.99.0.32:25646";