Skip to content

Instantly share code, notes, and snippets.

View qrtt1's full-sized avatar
💭
work from home

Ching Yi, Chan qrtt1

💭
work from home
View GitHub Profile
@hlb
hlb / Brewfile
Last active June 14, 2022 02:48 — forked from saetia/gist:1623487
Clean Install Script
cask_args appdir: '/Applications'
tap 'caskroom/cask'
tap "homebrew/cask-fonts"
tap 'caskroom/versions'
tap "homebrew/bundle"
tap "homebrew/core"
tap "homebrew/services"
tap "hsatac/toybox"
brew "coreutils"
brew "gnu-sed"
@staltz
staltz / introrx.md
Last active May 24, 2024 07:56
The introduction to Reactive Programming you've been missing
@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@debasishg
debasishg / gist:8172796
Last active May 10, 2024 13:37
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
AWS_ACCESS_KEY_ID="YOURAWSACCESSKEYID"
AWS_SECRET_KEY="YOURAWSSECRETKEY"
EC2_REGION=$(wget -q -O - http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}')
EC2_INSTANCE_ID=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)
EC2_CLOUDWATCH_NAMESPACE='WebService'
NGINX_CONNECTIONS=$(wget -q -O - http://127.0.0.1/nginx_status | grep 'connections' | awk '{print $3}')
/usr/bin/mon-put-data --region \"$EC2_REGION\" --metric-name HttpConnections --namespace \"$EC2_CLOUDWATCH_NAMESPACE\" --dimensions \"InstanceId=$EC2_INSTANCE_ID\" --value \"$NGINX_CONNECTIONS\" -I \"$AWS_ACCESS_KEY_ID\" -S \"$AWS_SECRET_KEY\"
@AVGP
AVGP / create_machine_switched.sh
Created April 18, 2013 11:30
Create UML machine with uml_switch networking
#!/bin/sh
### functions
f() { echo "Failed."; exit; }
setup_net()
{
echo "Configuring network"
while :; do
@zipkid
zipkid / gist:3496753
Created August 28, 2012 09:56
presign puppet cert
1. Generate a pre-signed certificate for client1.example.com with the following command:
puppet cert --generate client1.example.com
Puppet will now generate and sign a client certificate in the name of client1. example.com.
2. Transfer the three required files; the private key, the client certificate, and the CA certificate, to the new client. These are found in the following locations:
/etc/puppet/ssl/private_keys/client1.example.com.pem
/etc/puppet/ssl/certs/client1.example.com.pem
/etc/puppet/ssl/certs/ca.pem
Transfer these to the corresponding directories on the client, and it will then be authenticated without the certificate request step. Note that the location of Puppet's SSL certs varies according to the ssldir setting in puppet.conf.
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 23, 2024 18:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mtigas
mtigas / gist:952344
Last active April 3, 2024 07:57
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@koenbollen
koenbollen / punch.py
Created July 5, 2010 19:10
Proof of Concept: UDP Hole Punching
#!/usr/bin/env python
#
# Proof of Concept: UDP Hole Punching
# Two client connect to a server and get redirected to each other.
#
# This is the client.
#
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
#