Skip to content

Instantly share code, notes, and snippets.

View Julien00859's full-sized avatar
😴
425 - Too Early

Julien Castiaux Julien00859

😴
425 - Too Early
View GitHub Profile
@Dinnerbone
Dinnerbone / gist:3736487
Created September 17, 2012 09:49
New Minecraft target selector syntax!

Syntax

All target selectors start with @. The following character is the selector type. For example, @p means 'closest player'.

Target selectors may have additional, optional arguments. You can specify these in [ ], using the syntax a=0. For example, @p[a=0,b=5,c=-500].

There is a special short syntax for just specifying x, y, z and r arguments; simply list their values separated by a comma, without x=. For example: @p[100,64,-100,5] for 5 range, x=100, y=64 and z=-100. Each of these are optional and skippable by leaving them empty. For example, to just specify y coordinate: @p[,64].

Global Arguments:

  • x - X coordinate for search center. Default is senders coordinate, or 0.
  • y - Y coordinate for search center. Default is senders coordinate, or 0.
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active October 9, 2024 11:32
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@barrysteyn
barrysteyn / Base64.md
Last active September 24, 2024 04:37
OpenSSL Base64 En/Decode: Portable and binary safe.

OpenSSL Base64 Encoding: Binary Safe and Portable

Herewith is an example of encoding to and from base64 using OpenSSL's C library. Code presented here is both binary safe, and portable (i.e. it should work on any Posix compliant system e.g. FreeBSD and Linux).

License

The MIT License (MIT)

Copyright (c) 2013 Barry Steyn

@aquelito
aquelito / git-command.md
Last active November 16, 2024 18:57
GIT - Ligne de commande principale
title category
Git config
Git

Rappel

Ne pas oublier : l'aide en ligne de commande.

@chrisnew
chrisnew / postfix-wrapper.sh
Created January 21, 2015 14:18
postfix-wrapper.sh for supervisord in docker. Controls postfix as it gets controlled by supervisord.
#!/usr/bin/env bash
# postfix-wrapper.sh, version 0.1.0
#
# You cannot start postfix in some foreground mode and
# it's more or less important that docker doesn't kill
# postfix and its chilren if you stop the container.
#
# Use this script with supervisord and it will take
# care about starting and stopping postfix correctly.
#
@messa
messa / asyncio_ssl_example.py
Created June 26, 2015 12:43
Python asyncio + SSL TCP client/server example
#!/usr/bin/env python3
import asyncio
import multiprocessing
import os
import ssl
from time import sleep
port = 9000
#!/bin/bash
function startFw {
#Some ban
function banFw {
/sbin/iptables -A INPUT -s $1 -j DROP
}
banFw 41.228.12.228 #brute force ssh
banFw 220.247.238.16 #brute force ssh
banFw 218.85.135.29 #brute force ssh
@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active September 7, 2024 18:11 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@icanwalkonwater
icanwalkonwater / setup.sh
Last active November 19, 2018 08:42
Play ~aproximatively~ the melody when you open a chest in zelda games with the beeper of your pc. (you need to run it as root).
#!/bin/sh
gcc zelda_beep.c -o zelda_beep
# set the setuid bit to allow anyone to run this as root
sudo chown root:root zelda_beep
sudo chmod 4755 zelda_beep
./zelda_beep