Skip to content

Instantly share code, notes, and snippets.

View yolossn's full-sized avatar

S Santhosh Nagaraj yolossn

View GitHub Profile
@mchirico
mchirico / bashFor.go
Last active October 29, 2023 04:14
Go (golang) program to execute a bash for loop.
package main
import (
"bytes"
"fmt"
"log"
"os/exec"
"strings"
)
@kylemclaren
kylemclaren / findLongRunningOp.js
Last active September 24, 2024 12:05 — forked from comerford/killLongRunningOps.js
Find and (safely) kill long running MongoDB ops
db.currentOp().inprog.forEach(
function(op) {
if(op.secs_running > 5) printjson(op);
}
)

Exercises for Bash Beginner's Guide

Chapter 1

1. Where is the bash program located on your system?

A: In /bin/bash

2. Use the --version command to find out which version you are running.

@christopherlovell
christopherlovell / display.py
Last active November 18, 2023 22:22
display youtube video in jupyter notebook
from IPython.display import HTML
# Youtube
HTML('<iframe width="560" height="315" src="https://www.youtube.com/embed/S_f2qV2_U00?rel=0&amp;controls=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>')
# Vimeo
HTML('<iframe src="https://player.vimeo.com/video/26763844?title=0&byline=0&portrait=0" width="700" height="394" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe><p><a href="https://vimeo.com/26763844">BAXTER DURY - CLAIRE (Dir Cut)</a> from <a href="https://vimeo.com/dannysangra">Danny Sangra</a> on <a href="https://vimeo.com">Vimeo</a>.</p>')
@fedterzi
fedterzi / update_godaddy.py
Last active April 2, 2022 16:14
Python script to update a DNS record with GoDaddy API
#!/usr/bin/env python
# Import pif to get your public ip, sys and os.path
import pif, sys, os.path
# Partial imports
from godaddypy import Client, Account
# Remember to set your api key and secret
userAccount = Account(api_key='api_key', api_secret='api_secret')
@lightonphiri
lightonphiri / bash-install_google_fonts_on_ubuntu.md
Last active May 4, 2025 15:20
Install Google Fonts on Ubuntu

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip

@pgchamberlin
pgchamberlin / keycloak_aws_deployment.md
Last active October 25, 2024 09:00
Deploying Keycloak to AWS using a Ubuntu AMI

Deploying Keycloak to AWS

The objective of this guide is to deploy Keycloak to AWS in a minimally complex way for testing and discovery purposes. This means using the standalone build of Keycloak backed with Hibernate H2. The result is not a production ready system. It won't scale, it won't survive significant load, it can't be clustered.

Mostly this Gist is a distillation of the Keycloak Server Installation guide for a specific use case: to spin up a quick and dirty Keycloak instance for testing and experimenting.

Steps

  • Spin up and configure a Ubuntu AMI
  • Install and configure Keycloak with an SSL cert
@LastZactionHero
LastZactionHero / technical_skills_list.txt
Created November 26, 2016 18:58
Technical Skills List
.NET
360-degree video
3D Animation
3D Design
3D Model Maker
3D Modelling
3D Printing
3D Rendering
3ds Max
4D
@anvk
anvk / psql_useful_stat_queries.sql
Last active February 17, 2025 18:48
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@posener
posener / go-table-driven-tests-parallel.md
Last active April 24, 2025 20:46
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()