Skip to content

Instantly share code, notes, and snippets.

@jctosta
jctosta / screen_cheatsheet.markdown
Last active April 25, 2024 14:39
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@WajihaAd
WajihaAd / gist:c9d117fea0cdb072d959f0875c6ff7d2
Created April 25, 2024 14:38
Game Description This game simulates a battle between two teams: your team and the enemy team. The number of players in your team is randomly generated at the start of the game. Rules: Each team has an equal number of players. The game generates pairs of numbers and matches them. If the numbers in a pair match, the enemy team gets hit. If the nu…
#include <iostream>
#include <stdlib.h> // for rand
using namespace std;
class Team {
private:
static int count;
static int count1;
public:
@fransr
fransr / bucket-disclose.sh
Last active April 25, 2024 14:38
Using error messages to decloak an S3 bucket. Uses soap, unicode, post, multipart, streaming and index listing as ways of figure it out. You do need a valid aws-key (never the secret) to properly get the error messages
#!/bin/bash
# Written by Frans Rosén (twitter.com/fransrosen)
_debug="$2" #turn on debug
_timeout="20"
#you need a valid key, since the errors happens after it validates that the key exist. we do not need the secret key, only access key
_aws_key="AKIA..."
H_ACCEPT="accept-language: en-US,en;q=0.9,sv;q=0.8,zh-TW;q=0.7,zh;q=0.6,fi;q=0.5,it;q=0.4,de;q=0.3"
H_AGENT="user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36"
@dhh
dhh / linux-setup.sh
Last active April 25, 2024 14:37
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl docker.io \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
@einblicker
einblicker / gist:1324435
Created October 29, 2011 13:19
hurst exponent
import math.{pow, log, sqrt}
import java.util.Random
import org.apache.commons.math.stat.StatUtils.mean
import org.apache.commons.math.stat.regression.SimpleRegression
object HurstExponent extends App {
def hurstExponent(xs: Array[Double]): Double = {
def S(xs: Array[Double]): Double = {
val meanXs = mean(xs)
@johanmeiring
johanmeiring / gist:3002458
Created June 27, 2012 08:32
"git lg" alias for pretty git log
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
%reset-Button {
border: none;
margin: 0;
padding: 0;
width: auto;
overflow: visible;
background: transparent;
/* inherit font & color from ancestor */
@Mishco
Mishco / content.md
Last active April 25, 2024 14:29
Setup HashiCorp Vault on docker

Setup HashiCorp Vault on docker

Vault secures, stores, and tightly controls access to tokens, passwords, certificates, API keys, and other secrets in modern computing. Vault is primarily used in production environments to manage secrets. Vault is a complex system that has many different pieces. There is a clear separation of components that are inside or outside of the security barrier. Only the storage backend and the HTTP API are outside, all other components are inside the barrier.

Vault_architecture

Figure 1: Architecture of Vault and Spring App (Click to enlarge)

The storage backend is untrusted and is used to durably store encrypted data. When the Vault server is started, it must be provided with a storage backend so that data is available across restarts. The HTTP API similarly must be started by the Vault server on start so that clients can interact with it.

layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose

@aslakhellesoy
aslakhellesoy / del.txt
Created December 27, 2013 21:27
Delete redis keys by wildcard
eval "return redis.call('del', unpack(redis.call('keys', 'foo.*')))" 0