Skip to content

Instantly share code, notes, and snippets.

View adithya321's full-sized avatar
🏠
Working remotely

Adithya Jayasankar adithya321

🏠
Working remotely
View GitHub Profile

Keybase proof

I hereby claim:

  • I am adithya321 on github.
  • I am adithya321 (https://keybase.io/adithya321) on keybase.
  • I have a public key whose fingerprint is A7BC CE0F 9498 4464 BB62 314B 2361 D7A9 E754 5955

To claim this, I am signing this object:

@adithya321
adithya321 / bash: pg: Backup PostgreSQL database.txt
Created April 8, 2021 05:11
pg_dump is a utility for backing up a PostgreSQL database. It makes consistent backups even if the database is being used concurrently. pg_dump does not block other users accessing the database (readers or writers). Dumps can be output in script or archive file formats.
pg_dump -h localhost -U prisma -Fc prisma > customdumpfile
./logcli-darwin-amd64 query '{job="varlogs"}' --from='2021-01-02T00:30:00.000Z' --to='2021-01-02T18:30:00.000Z' --limit=999999 --batch=5000 -o raw > logs.txt
{
cd ~
mv .zsh_history .zsh_history_bad
strings .zsh_history_bad > .zsh_history
fc -R .zsh_history
}
docker run -it -p 1883:1883 -p 9001:9001 eclipse-mosquitto:1.6.12
@adithya321
adithya321 / bash: mac: Split files.txt
Last active October 25, 2020 10:12
# brew install coreutils -l 5000: split file into files of 5,000 lines each. -d: numerical suffix. This will make the suffix go from 00 to 99 by default instead of aa to zz. --additional-suffix: lets you specify the suffix, here the extension $FileName: name of the file to be split. file: prefix to add to the resulting files.
gsplit -l 5000 -d --additional-suffix=.log $FileName file-
npx @docusaurus/init@next init docusaurus-in-15-minutes classic
ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p'
find . -name '*.json' -print0 | xargs -0 sed -i "" "s/\"_type\":\"metric\"/\"_type\":\"_doc\"/g"