Skip to content

Instantly share code, notes, and snippets.

/*
This is an example of a golang gzip writer program,
which appends data to a file.
*/
package main
_log_pskb(date_created,link_id,logname,log)
account(id,uid,sum)
account_attach(account_id,file_id,name,orig_name)
account_transaction(user_id,yd)
activate_service(code,email,data)
admin_log_users(user_id,log_id,last_comment_view)
annoy(ip,last_req)
articles(title,short,msgtext,sign,logo,link)
articles_comments(from_id,parent_id,from_ip,created_time,article_id,msgtext,youtube_link)
articles_comments_files(comment_id,file_id,small,inline,temp)
@cornerot
cornerot / gist:4113092514d9e4446a261ac8d51dcce5
Created December 29, 2016 12:35 — forked from tjheeta/gist:654a246d18fea65b2da0
Build OpenSSH RPM for Centos
sudo yum install -y pam-devel
sudo yum install -y rpm-build
sudo yum install -y zlib-devel
mkdir -p ~/rpmbuild/SOURCES
cd ~/rpmbuild/SOURCES
wget -c http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.7p1.tar.gz
wget -c http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.7p1.tar.gz.asc
# verify the file
# update the pam ssd from the one included on the system
@cornerot
cornerot / ansible-linode-template.yml
Created August 7, 2017 13:21 — forked from vicendominguez/ansible-linode-template.yml
Ansible Linode template (tested and working)
#### CentOS: yum install pip ; pip install linode-python ; pip install chube
####
- hosts: localhost
connection: local
gather_facts: false
tasks:
- name: Create linode server
linode:
api_key: '---LINODE-API-KEY-HERE---'
@cornerot
cornerot / spectre.c
Created January 4, 2018 10:06 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@cornerot
cornerot / zook_grow.md
Created November 26, 2018 21:42 — forked from miketheman/zook_grow.md
Adding nodes to a ZooKeeper ensemble

Adding 2 nodes to an existing 3-node ZooKeeper ensemble without losing the Quorum

Since many deployments may start out with 3 nodes and so little is known about how to grow a cluster from 3 memebrs to 5 members without losing the existing Quorum, here is an example of how this might be achieved.

In this example, all 5 nodes will be running on the same Vagrant host for the purpose of illustration, running on distinct configurations (ports and data directories) without the actual load of clients.

YMMV. Caveat usufructuarius.

Step 1: Have a healthy 3-node ensemble

@cornerot
cornerot / download-from-facecast.md
Created June 11, 2019 12:28 — forked from bigspawn/download-from-facecast.md
How download video from facecast.net
@cornerot
cornerot / gist:a03861ead7e2f4845302235fe8b0fcd7
Created July 15, 2019 21:34 — forked from khakimov/gist:3558086
Matrix Effect in you terminal
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
@cornerot
cornerot / keybase.md
Last active October 4, 2019 20:44
keybase

Keybase proof

I hereby claim:

  • I am cornerot on github.
  • I am rrom (https://keybase.io/rrom) on keybase.
  • I have a public key ASBP9mQTrZoQweS7fbDmO2h7u9SsJ_ehHiOcFOh0TA9ffgo

To claim this, I am signing this object:

@cornerot
cornerot / tailc
Created November 27, 2019 16:09 — forked from liufuyang/tailc
Color output of linux tail command
#!/bin/bash
# save this file as tailc then
# run as: $ tailc logs/supplier-matching-worker.log Words_to_highlight
file=$1
if [[ -n "$2" ]]; then
color='
// {print "\033[37m" $0 "\033[39m"}
/(WARN|WARNING)/ {print "\033[1;33m" $0 "\033[0m"}
/(ERROR|CRIT)/ {print "\033[1;31m" $0 "\033[0m"}