Skip to content

Instantly share code, notes, and snippets.

@sonalranjit
sonalranjit / linkedTemplate.json
Last active October 3, 2022 17:54
Azure linkedTemplate
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string"
},
"vmName": {
"type": "string"
},
@sonalranjit
sonalranjit / tmux-cheatsheet.markdown
Created July 8, 2019 13:25 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDD9bhidIvVZsE/BCGXSKaTfBAm/+oQiFC5pMRvpymD0hpt5M6pH4olj9qtWUaLvO+PkCAwFEPkHJzyirddwJKdDcv7O9tVHIlGbb+UJCOPpiWHrHtwz37+Y4+2hjoBao+3sHVx0lIV+vWJ0FVg2c0ig15lmA8p0cYCT9e6Pz1wWBWw9AzoPPMT345OodrPizSSgKNProxSRgS+a0Eq06n0f61jqYqRlVe8VJsL15pdpzC4oxp32AKBBPBIZ2gdF7UaoLVA9rFnadP6miSKCXZstNV71HhT4zi4qzJRV5ysIz2/YzHSY7ZeU6hxU1bDdWgitHnVvyYd8vTKMqA+Hh5v sonal@sonal.local
@sonalranjit
sonalranjit / Accessing postgres from windows bash
Created September 1, 2017 00:02
Accessing postgres from windows bash
Install Postgresql for Windows (the actual .exe not Linux Bash)
Create User & Password for Postgresql (I use postgres & password for my local development)
Install `postgresql-client-common`, `postgresql-client`, `and libpq-dev` (In Bash)
Run a sanity check in Bash to verify that things are working `psql -p 5432 -h localhost -U postgres`
If you get a psql prompt you're good to go, now you can do what you need to do (my particular situation was to get Rails running)
If you have errors well then you may just need to peck away at things and double check that your Postgres server is running in Windows
@sonalranjit
sonalranjit / arkitiOSworkaround
Created August 15, 2017 00:12
workaround for arkit error
s_CurAffineTransform = [frame displayTransformForOrientation:[[UIApplication sharedApplication] statusBarOrientation] viewportSize:nativeSize];
@sonalranjit
sonalranjit / gist:8aeb4149c30918a6be63209fc5331c02
Last active July 11, 2017 19:48
Properly clone git repo with git lfs
// Skip smudge - We'll download binary files later in a faster batch
git lfs install --skip-smudge
// Do git clone here
git clone ...
// Fetch all the binary files in the new clone
git lfs pull
// Reinstate smudge
@sonalranjit
sonalranjit / AssetBundleSample.cs
Created March 14, 2017 18:17 — forked from yaeda/AssetBundleSample.cs
Unity AssetBundle Examples.
using System;
using UnityEngine;
using System.Collections;
public class AssetBundleSample : MonoBehaviour {
public GUIText guitext;
// Use this for initialization
void Start () {
@sonalranjit
sonalranjit / remove_postgres_on_mac_os.md
Created March 10, 2017 01:28 — forked from Atlas7/remove_postgres_on_mac_os.md
Note - How completely uninstall PostgreSQL 9.X on Mac OSX

This blog post has helped me clean up my postgres development environment on Mac. So making a copy!

How completely uninstall PostgreSQL 9.X on Mac OSX

This article is referenced from stackoverflow:

If installed PostgreSQL with homebrew , enter brew uninstall postgresql

If you used the EnterpriseDB installer , follow the following step.
@sonalranjit
sonalranjit / cronjob_format.md
Last active January 21, 2017 21:34
How to do crons

Installing a new cron

  1. type crontab -e to open the crontab file, this is where you add a task for cron to perform.
  2. have to specify the path to all the functions in the terminal, cronjob by default won’t recognize any function that you type, example if you create a cron task that will run a php script like: php phpscript.php it will not recognize the function php unless you specify the path.
  3. to specify all the function paths on the machine to for cron you have to add this line in the top of the crontab -e file. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  4. first 5 elements in a cron task line is to define the time to run the task.
  5. format: * * * * * sh script.sh
  6. The first five fields are: [minute 0-59] [hour 0-23] [day of the month 1-31] [month of the year 1-12] [day of the week 0-6 with 0 = Sunday, 1= Monday]
@sonalranjit
sonalranjit / README.md
Created August 23, 2016 20:50 — forked from pklaus/README.md
Generating Random MAC Addresses with Python

TODO

  • Create a CLI-Interface with the following options:
    • Unicast or Multicast? Default: Unicast
    • Locally Administered or Globally Unique? Default: Locally Administered
    • Prescribe specific OUI (overwrites the above two)
    • Number of MACs to generate (they should not collide and be piped out separated by newlines)

Resources