Skip to content

Instantly share code, notes, and snippets.

@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.
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 / 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
#!/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