Skip to content

Instantly share code, notes, and snippets.

@egor7
egor7 / a.c
Created February 14, 2022 00:51 — forked from lukechampine/a.c
a.c (with a.h expanded)
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<sys/mman.h>
typedef void V;typedef int I;typedef double F;typedef unsigned char C,*S;typedef long L;
#define O printf
#define R return
#define I(a...) if(a)
#define W(a...) while(a)
@egor7
egor7 / .emacs
Last active June 13, 2020 20:04
_emacs 2020-06
; -*-Emacs-Lisp-*-
;
; .bashrc
; # no ncurces glitches
; [[ $- == *i* ]] && stty sane
; export TERM=linux
;
; C-x RET r - revert buffer with coding system
;
; M-x occur - show minibuffer with searched results
@egor7
egor7 / k_file_analytics.md
Created March 13, 2020 12:32 — forked from chrispsn/k_file_analytics.md
K usage statistics

Analytics on k code

Mildly interesting results from string analysis of a handful of k files. If you have more public k files or suggestions for further analysis, comment below!

This uses the latest Shakti.

Corpus:

@egor7
egor7 / p67
Created January 3, 2020 12:26
59
73 41
52 40 09
26 53 06 34
10 51 87 86 81
61 95 66 57 25 68
90 81 80 38 92 67 73
30 28 51 76 81 18 75 44
84 14 95 87 62 81 17 78 58
21 46 71 58 02 79 62 39 31 09
75
95 64
17 47 82
18 35 87 10
20 04 82 47 65
19 01 23 75 03 34
88 02 77 73 07 63 67
99 65 04 28 06 16 70 92
41 41 26 56 83 40 80 70 33
41 48 72 33 47 32 37 16 94 29
@egor7
egor7 / gist:5dfc981816d6461fc1c86c6176788ad2
Created September 25, 2019 19:18 — forked from cnauroth/gist:7ff52e9f80e7d856ddb3
Hadoop NameNode JMX REST Query for NameNodeStatus
> curl 'http://172.20.11.177:50070/jmx?qry=Hadoop:service=NameNode,name=NameNodeStatus'
{
"beans" : [ {
"name" : "Hadoop:service=NameNode,name=NameNodeStatus",
"modelerType" : "org.apache.hadoop.hdfs.server.namenode.NameNode",
"State" : "active",
"NNRole" : "NameNode",
"HostAndPort" : "localhost:19000",
"SecurityEnabled" : false,
"LastHATransitionTime" : 0
@egor7
egor7 / formatted
Created August 20, 2019 16:48 — forked from marcellodesales/formatted.sh
One-liner REST server using netcat - nc
rm -f out
mkfifo out
trap "rm -f out" EXIT
while true
do
cat out | nc -l 1500 > >( # parse the netcat output, to build the answer redirected to the pipe "out".
export REQUEST=
while read line
do
line=$(echo "$line" | tr -d '[\r\n]')

From: https://beta.psy-dreamer.com/category/automation/deploying-from-github-to-vps-using-travis-ci

Recently, I spent around 14 to 16 hours learning all of the necessary steps to getting an existing repo set up with Travis CI to run unit tests, and then once successful, connect to a remote server that isn't a PaaS (in this case, Linode) and then proceeds to use Git hooks to do post deployment things.

Starting with your local machine and you have your project already checked out from Github.

Setting Up

  • Assuming you have Ruby (at least 2.3.1) installed, run gem install travis. This installs the Travis CI command-line tools. We're going to use these tools to encrypt RSA keys that Travis will use to connect to your remote server.
  • This tutorial also assumes that you have a working repo and a Travis-CI account set up.

NES emulator development guide

Overview of document

@egor7
egor7 / makeauthority.sh
Created July 6, 2018 13:45 — forked from richieforeman/makeauthority.sh
Issue Your Own Self-Signed S/MIME Certs with OpenSSL
# Run this once
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt