Skip to content

Instantly share code, notes, and snippets.

View akshithg's full-sized avatar

Gee akshithg

View GitHub Profile
@akshithg
akshithg / neo4j_switch_db.sh
Created October 3, 2023 23:55
Switch neo4j db on community edition
#!/usr/bin/env bash
set -eu
to=$1
active=$(cat /etc/neo4j/neo4j.conf | grep "initial.dbms.default_database" | cut -d'=' -f2)
echo "changing from *$active* to *$to*"
sudo sed -i "s/initial.dbms.default_database=$active/initial.dbms.default_database=$to/g" /etc/neo4j/neo4j.conf
@akshithg
akshithg / extractgc.sh
Created March 7, 2023 19:03 — forked from xigh/extractgc.sh
Extracting LLVM bitcode from ELF files generated with -fembed-bitcode.
#!/bin/sh
if [ "*$1" == "*" ]; then
echo "usage: extract.sh src dst"
fi
if [ "*$2" == "*" ]; then
echo "usage: extract.sh src dst"
fi
@akshithg
akshithg / large_matrix.txt
Created March 7, 2023 05:41
Cases of non-determinism in the kernel
---#
arch/x86/kernel/process.c:119
---
static int set_new_tls(struct task_struct *p, unsigned long tls)
{
struct user_desc __user *utls = (struct user_desc __user *)tls;
if (in_ia32_syscall()) ## x ##
return do_set_thread_area(p, -1, utls, 0);
else
@akshithg
akshithg / 55-bytes-of-css.md
Created September 25, 2022 23:34 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@akshithg
akshithg / .config
Last active June 8, 2021 23:27
tinyconfig++
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.10.0 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="clang version 11.1.0 (git@github.com:llvm/llvm-project.git 1fdec59bffc11ae37eb51a1b9869f0696bfd5312)"
CONFIG_GCC_VERSION=0
CONFIG_LD_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_LD_IS_LLD=y
CONFIG_CLANG_VERSION=110100
#!/usr/bin/env python3
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import http.server
#!/usr/bin/env python3
import glob
import os
files = glob.glob("./callgraph/*")
cmd = """awk 'FNR==NR {a[$0]++; next} !a[$0]' {} {} | sort | uniq >> x"""
@akshithg
akshithg / Blockstack ID
Created August 7, 2019 19:58
Blockstack ID
Verifying my Blockstack ID is secured with the address 12M3oyd497SG2hza6vyPakhPgNhbDcSe5p https://explorer.blockstack.org/address/12M3oyd497SG2hza6vyPakhPgNhbDcSe5p
@akshithg
akshithg / nconnect.py
Created September 15, 2018 22:58
python nc
#!/usr/bin/env python
import socket
class NConnect:
def __init__(self, host, port):
self.host = host
self.port = port
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Verifying my Blockstack ID is secured with the address 1FRwm4jfPt75h5n1PLc1vw3QkdisvyMiLt https://explorer.blockstack.org/address/1FRwm4jfPt75h5n1PLc1vw3QkdisvyMiLt