Skip to content

Instantly share code, notes, and snippets.

View adpande's full-sized avatar

Abhishek Pande adpande

View GitHub Profile
@adpande
adpande / nats_config.go
Last active March 22, 2024 07:32
Read Config from Nats Bucket in Golang
// nats kv add config
// nats kv create config host localhost
// nats kv create config port 8080
type AppConfig struct {
Host string `natsKey:"host" natsDefault:"localhost"`
Port int64 `natsKey:"port" natsDefault:"8080"`
}
@adpande
adpande / instructions.md
Created December 6, 2022 10:38 — forked from matthewjberger/instructions.md
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

@adpande
adpande / mem.sh
Created November 19, 2022 22:03
get memory of process in linux
ps -eo size,pid,user,command --sort -size | \
awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' |\
cut -d "" -f2 | cut -d "-" -f1
#!/bin/bash
sink=alsa_output.pci-0000_0a_00.4.analog-surround-21
# pactl set-default-sink alsa_output.pci-0000_0a_00.4.analog-surround-21
# usage
# chmod +x sound.sh
# sound.sh <function>
default(){
pactl set-default-sink $sink
}
@adpande
adpande / smart-caps-lock.md
Created April 25, 2022 06:50 — forked from tanyuan/smart-caps-lock.md
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
@adpande
adpande / app.py
Created January 26, 2022 11:31 — forked from seratch/app.py
Two Slack App Installation Flow Example (Flask + SQLAlchemy)
import logging
from typing import Callable
logging.basicConfig(level=logging.DEBUG)
logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO)
import os
from slack_bolt import App, BoltContext, Ack
from slack_bolt.adapter.flask import SlackRequestHandler
from slack_bolt.oauth.oauth_settings import OAuthSettings
@a = 1
@adpande
adpande / install-comodo-ssl-cert-for-nginx.rst
Created April 26, 2018 13:43 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

package actors
import akka.actor.Actor
import akka.actor.Props
import akka.event.Logging
import indexing.{TopicIndexManager, TopicIndex}
/**
*
* User: apande