Skip to content

Instantly share code, notes, and snippets.

@jadeallenx
jadeallenx / t.erl
Created February 10, 2012 22:56
Erlang parameter validation
% Post/Query string parameter validation.
%
% Mark Allen, mrallen1@yahoo.com
%
% Specs [{{name, "param_name"}, {required, true}, {type, function}}, ... ]
% Input [{"name", "value}, ...] just you'd get from post or query string parameters
-module(t).
-export([test/0, test1/0, test2/0]).
http:request(get, {"http://hostname/resource", [{"Authorization", "Basic " ++ base64:encode_to_string("username:password")}]}, [], []).
@adamgotterer
adamgotterer / Dockerfile
Created June 20, 2018 15:48
Puppeteer headless chrome with chroxy
FROM node:8-slim
ARG DEBIAN_FRONTEND=noninteractive
ENV PUPPETEER_VERSION 1.5.0
ENV CHROXY_VERSION 0.3.2
RUN apt-get update -qqy \
&& apt-get -qqy install \
unzip gnupg curl wget ca-certificates apt-transport-https \
git ttf-wqy-zenhei g++ libzmq3-dev apt-utils vim \
@sergium
sergium / example.erl
Created September 8, 2015 09:15
Erlang OTP gen_server template
%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 et
%% @author Kevin Smith <kevin@opscode.com>
%% @copyright 2011 Opscode, Inc.
-module(example).
-behaviour(gen_server).
-export([start_link/0]).
@IQAndreas
IQAndreas / caesar-cipher.sh
Last active August 30, 2023 09:39
A really simple Caesar Cipher in Bash (or Shell) using `tr`, can also easily be adjusted to encrypt/decrypt ROT13 instead.
# Caesar cipher encoding
echo "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" | tr '[A-Z]' '[X-ZA-W]'
# output: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
# Caesar cipher decoding
echo "QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD" | tr '[X-ZA-W]' '[A-Z]'
# output: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
# Can also be adjusted to ROT13 instead
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@efcasado
efcasado / eqc.md
Last active December 16, 2023 00:07
A gentle introduction to (Erlang) QuickCheck

Erlang QuickCheck

What is QuickCheck?

QuickCheck is a language for stating properties of programs.

?FORALL(X, nat(), X*X >= 0)
#!/usr/bin/env python
# Based on https://www.openwall.com/lists/oss-security/2018/08/16/1
# untested CVE-2018-10933
import sys, paramiko
import logging
username = sys.argv[1]
hostname = sys.argv[2]
command = sys.argv[3]
@cryptolok
cryptolok / vMetaDate.sh
Last active February 4, 2024 12:12
small tool to retreive vk.com (vkontakte) users hidden metadata (state, access, dates, counts, etc) anonymously (without login)
#!/bin/bash
# small tool to retreive vk.com (vkontakte) users hidden metadata (state, access, dates, counts, etc) anonymously (without login)
# sudo apt install curl
parse(){
local IFS=\>
read -d \< CELL VALUE
}
@alvaromgdev
alvaromgdev / consumer_ps3838_api.py
Created June 26, 2019 21:08
Script to connect to ps3838 API
import base64
import requests
from enum import Enum
"""
Script to connect to ps3838 API
URL to check API User Guide:
https://www.tender88.com/static/index.php/es-es/help/api-user-guide-es-es