Skip to content

Instantly share code, notes, and snippets.

@mohamedadaly
mohamedadaly / bw_export_kp.py
Last active April 14, 2024 03:57
Export Bitwarden to KeePass 2 XML format
#!/usr/bin/python
from __future__ import print_function
import base64
import commands
import json
import sys
import uuid
import xmltodict
@tomaszpolanski
tomaszpolanski / logging.kt
Last active February 7, 2021 15:24
RxLogging
@file:Suppress("NOTHING_TO_INLINE")
import android.util.Log
import io.reactivex.*
inline fun <reified T> printEvent(tag: String, success: T?, error: Throwable?) =
when {
success == null && error == null -> Log.d(tag, "Complete") /* Only with Maybe */
success != null -> Log.d(tag, "Success $success")
error != null -> Log.d(tag, "Error $error")
@jinie
jinie / gist:712d397cfa37bcb836b5
Created July 17, 2015 12:12
EdgeOS GeoIP blocking
#!/usr/bin/env python
import os
import urllib2
countries={'DK':'denmark'}
os.system("/opt/vyatta/sbin/vyatta-cfg-cmd-wrapper begin")
for country in countries.keys():