Skip to content

Instantly share code, notes, and snippets.

View sdushantha's full-sized avatar

Siddharth Dushantha sdushantha

View GitHub Profile
@sdushantha
sdushantha / test
Last active February 23, 2023 22:31
hello
@sdushantha
sdushantha / eduroam.sh
Created August 23, 2021 16:34 — forked from AntonFriberg/eduroam.sh
Connect to eduroam on Lund University with NetworkManager
nmcli con add \
type wifi \
con-name "eduroam"
ifname "wlp4s0" \ # Your wifi interface
ssid "eduroam" \
wifi-sec.key-mgmt "wpa-eap" \
802-1x.identity "<YOUR-STUDENT-ID>@lu.se" \ # May also use another university identification
802-1x.password "<YOUR-PASSWORD" \
802-1x.system-ca-certs "yes" \
802-1x.domain-suffix-match "radius.lu.se" \
@sdushantha
sdushantha / ytdl.py
Created May 22, 2021 10:53
Very short YouTube downloader. Extraction of video is done through code, no external modules.
#!/usr/bin/env python3
#
# by Siddharth Dushantha (sdushantha)
#
# My very simple version of youtube-dl.
#
# Credits: https://git.io/JTPr9
#
import re
@sdushantha
sdushantha / apple-serial.py
Last active September 23, 2020 08:37
Get the basic device specs based on serial number for Apple Devices. Useful to check inventory
import requests
import sys
# Can be 'computer' or 'tablet'
deviceType = "computer"
serialNumber = input("Serial: ")
print()
data = {
'cat': 'computer',

Source code for graph used in EE

import matplotlib.pyplot as plt
from collections import Counter, OrderedDict
import requests

r = requests.get("https://sherlock-holm.es/stories/plain-text/cano.txt")
text = r.text

chars_to_remove = []
lyrics_directory = ~/.config/ncmpcpp/lyrics
mpd_music_dir = ~/Music
visualizer_type = "spectrum"
visualizer_look = ●┃
visualizer_color = white
song_list_format = "{{%a %t}|{%f}}{$R%l}"
current_item_prefix = $(green)$r
current_item_inactive_column_prefix = $(black)$r
class text:
purple = "\033[95m"
cyan = "\033[96m"
darkcyan = "\033[36m"
blue = "\033[94m"
green = "\033[92m"
yellow = "\033[93m"
red = "\033[91m"
magenta = "\033[35m"
white = "\033[37m"
$ python3 setup.py sdist
$ python3 -m twine upload dist/*
@sdushantha
sdushantha / instructions.md
Last active March 6, 2026 18:42
ncmpcpp + mpd + mpc on macOS

Install the required packages

brew install ncmpcpp mpd mpc

Make the.mpd directory in your home directory

mkdir ~/.mpd