Skip to content

Instantly share code, notes, and snippets.

View tejainece's full-sized avatar

Ravi Teja Gudapati tejainece

View GitHub Profile
@tejainece
tejainece / ramblings.md
Created April 18, 2024 11:14
ramblings

x86 GAS uses reverse order of destination and source registers compared to Intel documentation. This was very confusing.

@tejainece
tejainece / run.sh
Last active January 20, 2022 13:51
webdriver
curl 'http://localhost:9515/status'
# Create new headless session
curl -XPOST 'http://localhost:9515/session' -d '{"desiredCapabilities": {"browserName": "chrome", "goog:chromeOptions": {"args": ["--headless", "--no-sandbox"]}}}'
# Navigate to URL
curl -XPOST "http://localhost:9515/session/$1/url" -d '{"url": "https://google.com"}'
# Execute script
curl -XPOST http://localhost:9515/session/$1/execute/sync -d '{"script": "window.alert(\"Annoying\")", "args": []}'
@tejainece
tejainece / index.html
Last active August 21, 2020 06:39
Dart: Drawing triangle using WebGL
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="scaffolded-by" content="https://github.com/dart-lang/stagehand">
<title>Dart WebGL triangle</title>
<style>
@tejainece
tejainece / mersenne_predict.py
Created May 7, 2020 14:51 — forked from Rhomboid/mersenne_predict.py
Predict output of Mersenne Twister after seeing 624 values
#!/usr/bin/env python
#
# Mersenne Twister predictor
#
# Feed this program the output of any 32-bit MT19937 Mersenne Twister and
# after seeing 624 values it will correctly predict the rest.
#
# The values may come from any point in the sequence -- the program does not
# need to see the first 624 values, just *any* 624 consecutive values. The
# seed used is also irrelevant, and it will work even if the generator was
@tejainece
tejainece / .zshrc
Last active December 13, 2019 10:35
zsh config file
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/tejag/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@tejainece
tejainece / .vimrc
Last active June 27, 2023 11:44
My .vimrc
filetype plugin indent on
syntax on
set autoread
set autowrite
set number
" Enable mouse
set mouse=a
@tejainece
tejainece / tmux-cheatsheet.markdown
Created November 16, 2019 16:40 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@tejainece
tejainece / postgres-cheatsheet.md
Created June 2, 2019 14:39 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@tejainece
tejainece / postgres_cheat_sheet
Created June 1, 2019 20:42 — forked from johnnyjung/postgres_cheat_sheet
Postgres Cheat Sheet
Postgres Cheat Sheet
Source: Postgresql Documentation
### shell commands
creatuser <user>
deletesuer <user>
createdb -O <user> -E utf8 -T <template> <db_name>
dropdb <db_name>
@tejainece
tejainece / install_kube.sh
Last active January 25, 2019 22:19
Install kubernetes on Ubuntu
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add
sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
sudo apt install kubeadm