Skip to content

Instantly share code, notes, and snippets.

View techgaun's full-sized avatar
🌌
Enum.random(["code", "sleep", "eat", "fifa", "soccer", "guitar", "board games"])

Samar Dhwoj Acharya techgaun

🌌
Enum.random(["code", "sleep", "eat", "fifa", "soccer", "guitar", "board games"])
View GitHub Profile
@techgaun
techgaun / hand-modify-pdf.md
Created July 17, 2023 14:06 — forked from senderle/hand-modify-pdf.md
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

@techgaun
techgaun / cloud_metadata.txt
Created August 8, 2019 18:50 — forked from BuffaloWill/cloud_metadata.txt
Cloud Metadata Dictionary useful for SSRF Testing
## IPv6 Tests
http://[::ffff:169.254.169.254]
http://[0:0:0:0:0:ffff:169.254.169.254]
## AWS
# Amazon Web Services (No Header Required)
# from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-categories
http://169.254.169.254/latest/meta-data/iam/security-credentials/dummy
http://169.254.169.254/latest/user-data
http://169.254.169.254/latest/user-data/iam/security-credentials/[ROLE NAME]
@techgaun
techgaun / postgres_queries_and_commands.sql
Last active November 26, 2020 04:19 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@techgaun
techgaun / The Technical Interview Cheat Sheet.md
Created August 31, 2017 03:25 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@techgaun
techgaun / readme.md
Created February 5, 2017 04:44
OpenSSH 7.4 on Ubuntu 16.04

Installing OpenSSH 7.4 on Ubuntu 16.04

sudo apt install -y build-essential libssl-dev zlib1g-dev
wget "http://mirrors.evowise.com/pub/OpenBSD/OpenSSH/portable/openssh-7.4p1.tar.gz"
tar xfz openssh-7.4p1.tar.gz
cd openssh-7.4p1
./configure
make
sudo make install
@techgaun
techgaun / erlang-19-elixir.1.3-raspberry-pi.md
Last active May 19, 2019 06:36
Install Erlang 19.2 and Elixir 1.3 on Raspberry Pi

This has been tested on Raspbian

Install Erlang 19.2

apt-get install -y libssl-dev ncurses-dev
wget http://www.erlang.org/download/otp_src_19.2.tar.gz
wget -q -O - https://raw.githubusercontent.com/techgaun/extract/master/extract >> ~/.bashrc # I already had [this](https://github.com/techgaun/extract)
extract otp_src_19.2.tar.gz
cd otp_src_19.2
@techgaun
techgaun / influxdb-amazon-linux.md
Last active February 13, 2020 11:21
InfluxDB on Amazon Linux

Last updated: 2017-03-22 : Update to 1.2.2

The following assumes you're executing as a root user

Pre-install

yum update
yum install -y git
mkdir -p /opt/influx/{wal,data,ssl}
@techgaun
techgaun / erlang-elixir-on-amazon-linux.md
Last active November 21, 2023 03:09
Running elixir 1.8.1 on amazon linux

Script

#!/bin/bash

yum install ncurses-devel openssl-devel -y
yum groupinstall "Development Tools" -y

cd /tmp
wget "http://erlang.org/download/otp_src_21.3.tar.gz" -O otp21.tar.gz
@techgaun
techgaun / postgres.md
Last active June 10, 2016 18:58
Postgresql Notes

Get all the keys in jsonb fields

select distinct jsonb_object_keys(sfdata) from accounts;

Get values of given key that's more than 0 in jsonb field

select (sfdata-&gt;&gt;'BUILDING_SIZE__C')::float from accounts where (sfdata-&gt;&gt;'BUILDING_SIZE__C' = '') is false and cast(sfdata-&gt;&gt;'BUILDING_SIZE__C' as float) &gt; 0 limit 5;