Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python3
import pymodbus
import serial
import math
from pymodbus.pdu import ModbusRequest
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
from pymodbus.transaction import ModbusRtuFramer
!/usr/bin/env bb
(require '[clojure.java.shell :refer [sh]])
(def expected (get (System/getenv "STAGE")
{ "dev" "12345"
"prod" "123456"}))
(def curr-account
@dbalan
dbalan / fhsUser.nix
Created December 11, 2019 14:05
Run cliqz browser in nixos
# 1. curl -LO https://cdn.cliqz.com/browser-f/download/linux/cliqz.en-US.release.x86_64.tar.bz2
# 2. tar xf cliqz.en-US.release.x86_64.tar.bz2
# 3. add this file to cliqz/fhsUser.nix
# 4. cd cliqz/ && nix-shell fhsUser.nix
{ pkgs ? import <nixpkgs> {} }:
(pkgs.buildFHSUserEnv {
name = "example-env";
targetPkgs = pkgs: with pkgs; [
coreutils
];
0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.50+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1122 Tue Jun 19 12:21:21 BST 2018
[ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Raspberry Pi Zero W Rev 1.1
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] cma: Reserved 8 MiB at 0x1b400000
[ 0.000000] On node 0 totalpages: 114688
[ 0.000000] free_area_init_node: node 0, pgdat c09c04f8, node_mem_map db010000
[ 0.000000] Normal zone: 1008 pages used for memmap
(ns fizzbuzz.core
(:gen-class))
(defn series [arg] (take arg (range)))
(defn fizzbuzz [arg]
(cond
(and (= 0 (mod arg 3)) (= 0 (mod arg 5))) "fizzbuzz"
(= 0 (mod arg 3)) "fizz"
(= 0 (mod arg 5)) "buzz"
diff -ruN minio-client.bak/distinfo minio-client/distinfo
--- minio-client.bak/distinfo 2017-02-18 10:30:52.000000000 +0000
+++ minio-client/distinfo 2017-04-24 15:16:37.975411000 +0000
@@ -1,3 +1,3 @@
-TIMESTAMP = 1487205021
-SHA256 (minio-mc-2017.02.06.20.16.19-RELEASE.2017-02-06T20-16-19Z_GH0.tar.gz) = 2ee46a826ff961683d8ed25e18598576a68bdebe79dcce9adf3219d34f9ec64c
-SIZE (minio-mc-2017.02.06.20.16.19-RELEASE.2017-02-06T20-16-19Z_GH0.tar.gz) = 1009728
+TIMESTAMP = 1493046997
+SHA256 (minio-mc-2017.04.03.18.35.01-RELEASE.2017-04-03T18-35-01Z_GH0.tar.gz) = 0c3625057e48ba79de90425f67b435f12c6f51555ad6c4202c3c3f20e4ea2bf8
+SIZE (minio-mc-2017.04.03.18.35.01-RELEASE.2017-04-03T18-35-01Z_GH0.tar.gz) = 1025277

Keybase proof

I hereby claim:

  • I am dbalan on github.
  • I am dbalan (https://keybase.io/dbalan) on keybase.
  • I have a public key whose fingerprint is 4970 CC92 010A 4087 67C6 9904 ED54 26FA EC79 01DD

To claim this, I am signing this object:

module Main where
import Lib
import Text.HTML.Scalpel
data Image = Image String deriving Show
comicImage :: IO (Maybe [String])
comicImage = do
scrapeURL "http://doc.scrapy.org/en/latest/_static/selectors-sample1.html" comic
#!/usr/bin/env python
from gevent import monkey
monkey.patch_all()
import sys
from gevent.pool import Pool
from bs4 import BeautifulSoup
import requests
@dbalan
dbalan / lastfm_to_gmusic.py
Created July 13, 2016 20:19 — forked from Timmmm/lastfm_to_gmusic.py
Convert Last.fm loved tracks to your Google Play Store Music Play All Access Subscription Service by Google™. It creates a new playlist rather than adding the tracks to your library willy-nilly. See code for more details.
#!/usr/bin/env python
# Lastfm loved tracks to Google Music All Access playlist.
#
# Written by Tim Hutt, tdhutt@gmail.com, based on this script:
#
# https://gist.github.com/oquno/3664731
#
# Today is the 15th of September 2013.
#