Skip to content

Instantly share code, notes, and snippets.

View michaelbukachi's full-sized avatar

Michael Bukachi michaelbukachi

View GitHub Profile
@satishgunjal
satishgunjal / wifissid.py
Created October 14, 2018 07:20
Get connected wifi SSID using python on Raspberry pi
import subprocess
try:
output = subprocess.check_output(['sudo', 'iwgetid'])
print("Connected Wifi SSID: " + output.split('"')[1])
except Exception, e:
print e
@kairos34
kairos34 / ZipManager
Created March 19, 2019 15:06
Kotlin zip and unzip functions
object ZipManager {
fun zip(files: List<File>, zipFile: File) {
ZipOutputStream(BufferedOutputStream(FileOutputStream(zipFile))).use { output ->
files.forEach { file ->
(file.length() > 1).ifTrue {
FileInputStream(file).use { input ->
BufferedInputStream(input).use { origin ->
val entry = ZipEntry(file.name.toRealName())
output.putNextEntry(entry)
@3dprogramin
3dprogramin / selenium-cookies-importer.py
Last active May 8, 2024 18:40
Import cookies from text file into selenium webdriver
from selenium import webdriver
from time import sleep
# read cookies from file
# format
# ... expiry1 key1 value1
# ... expiry2 key2 value2
def read_cookies(p = 'cookies.txt'):
cookies = []
with open(p, 'r') as f: