Skip to content

Instantly share code, notes, and snippets.

View m13m's full-sized avatar
🏠
Working from home since 2021

Maqbool Khan m13m

🏠
Working from home since 2021
View GitHub Profile
@m13m
m13m / how-to-copy-aws-rds-to-local.md
Created April 9, 2021 14:48 — forked from syafiqfaiz/how-to-copy-aws-rds-to-local.md
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@m13m
m13m / postgres-cheatsheet.md
Created March 6, 2021 02:34 — 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)
@m13m
m13m / generate-ssh-key.sh
Created January 28, 2021 12:53 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@m13m
m13m / ffmpeg.md
Created May 30, 2019 21:16 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@m13m
m13m / minscalaactors.scala
Created August 8, 2018 22:51 — forked from viktorklang/minscalaactors.scala
Minimalist Scala Actors
/*
Copyright 2012 Viktor Klang
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@m13m
m13m / tutorial.md
Created July 17, 2018 09:17 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

@m13m
m13m / Matrix.md
Created May 27, 2018 19:09 — forked from nadavrot/Matrix.md
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

LambdaConf Travel Notes

The missing manual!

Anyway… The first thing you should know is that you're not the only one who couldn't fly into Boulder directly. Denver International Airport is the closest and only major airport associated with Boulder. It's only about 50 miles away from Boulder, so that's not too much of a hardship, especially since transit connections are so good (more on this in a bit).

The next thing you should know is that Denver International Airport (DIA) is not actually in Denver. DIA is slightly closer to Denver than it is to Boulder, but honestly not by that much. So if you were planning on taking advantage of your flight into "Denver" to site-see in the city… uh, that's probably not going to happen. In any event, while Denver is quite nice, Boulder is better in almost every detail except its lack of skyscrapers.

Denver (for… reasons)

@m13m
m13m / whatsappspam.js
Created January 7, 2018 12:56 — forked from flaredragon/whatsappspam.js
Whatsapp Spam Bot
/*
WhatsApp Web Spam Script written by flaredragon.
====================================================================================
DISCLAIMER: I do not take any responsibility for any damage caused with this script.
====================================================================================
Usage: Copy all of this script (Ctrl+A, Ctrl+C).Visit WhatsApp Web, select your
desired contact and Press Ctrl+Shift+I to and paste it in the console and press Enter.
(Imp Note - Whatsapp Controls the message sending rate so sending ~500 together may
cause your Whatsapp to hang so use the script smartly)
====================================================================================