Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -ex
echo "Installing Docker 20.10"
curl -sL https://releases.rancher.com/install-docker/20.10.sh | sh
systemctl enable docker --now
echo "Installing kubectl"
curl -LO https://dl.k8s.io/release/v1.24.10/bin/linux/amd64/kubectl
@anabarasan
anabarasan / tmux-cheatsheet.markdown
Created July 28, 2022 10:56 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
import random
class Wordle:
def __init__(self, test=False):
self.wordlist = None
# wordle_alpha.txt obtained from https://github.com/dwyl/english-words/blob/master/words_alpha.txt
with open("words_alpha.txt") as wordle_file:
wordlist = wordle_file.read().split("\n")
word_length = int(input("Word Length : "))
self.wordlist = [word for word in wordlist if len(word) == word_length]
@anabarasan
anabarasan / sshd_service_restart_example.py
Created March 21, 2021 16:15 — forked from gaurav36/sshd_service_restart_example.py
sshd service restart example using python dbus API
import sys
import dbus
bus = dbus.SystemBus()
systemd = bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1')
manager = dbus.Interface(systemd, 'org.freedesktop.systemd1.Manager')
def restart(service):
"""
restart method will restart service that is passed in this method.
"""coursera course list sorted by duration"""
#!/usr/bin/env python3
import csv
from http.server import SimpleHTTPRequestHandler
import json
from operator import itemgetter
from socketserver import TCPServer
import threading
from time import sleep
@anabarasan
anabarasan / organize
Created March 3, 2020 16:09
organize photos by `year/month/day/file` folder struction based on EXIF data
#!/usr/bin/env python3
from os import listdir
from os.path import dirname, exists, isfile, join
from pathlib import Path
import shutil
import sys
from PIL import ExifTags, Image, UnidentifiedImageError
@anabarasan
anabarasan / README.md
Created November 26, 2018 05:29 — forked from M1ke/README.md
Quickly convert a markdown file into a nice looking PDF formatted in the same way GitHub formats Readme.md files

Markdown to PDF

Quickly convert a markdown file into a nice looking PDF formatted in the same way GitHub formats Readme.md files

  • Install grip $ pip install grip
  • Install wkhtmltopdf $ sudo apt-get install wkhtmltopdf
@anabarasan
anabarasan / game_of_life.py
Created August 14, 2018 19:10
Conway's Game of Life
#!/usr/bin/env python3
from argparse import ArgumentParser
from enum import Enum
from sys import argv
from time import sleep
BLOCK = [(5,5), (5,6), (6,5), (6,6)]
BLINKER = [(4,4), (4,5), (4,6)]
@anabarasan
anabarasan / Dockerfile
Created March 13, 2018 02:12
c9ide docker file WIP
FROM ubuntu:16.04
MAINTAINER Anbarasan G <nasarabna@gmail.com>
ARG username=admin
ARG password=admin
ARG port=8181
@anabarasan
anabarasan / install_packages.sh
Last active January 30, 2017 02:10
install Google Chrome, Visual Studio Code and R in ubuntu
# get ubuntu release name
source /etc/lsb-release
# Git
sudo apt-get -y install git
sudo apt-get install -y python-software-properties software-properties-common
# pip
wget -O get-pip.py https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py