Skip to content

Instantly share code, notes, and snippets.

View sarg's full-sized avatar

Sergey Trofimov sarg

View GitHub Profile
@sarg
sarg / Problems.java
Created April 7, 2020 16:20
test problems
/*
Mask all digits in credit card number unless they are first or last four characters.
Never mask credit cards less than 6 characters
*/
class CreditCard {
/**
* Mask credit card number for display.
*/
public static String maskify(String creditCardNumber) {
// Never mask credit cards with less than 6 characters.
@sarg
sarg / guix-geiser.el
Created March 29, 2020 19:04
Make geiser find guix package definitions
(defun geiser-edit--goto-line-guix (symbol line)
(unless (numberp line)
(goto-char (point-min))
(when (re-search-forward
(rx (seq "(define-public"
(one-or-more " ")
symbol-start (literal (format "%s" symbol)) symbol-end))
nil t)
(goto-char (match-beginning 0)))))
@sarg
sarg / velobike.py
Created December 2, 2017 08:16
Fetch velobike.ru statistics.
import requests
from requests.auth import HTTPBasicAuth
settings = {
'url' : 'http://apivelobike.velobike.ru',
'login' : '',
'pin' : '',
'year' : '2017'
}

Keybase proof

I hereby claim:

  • I am sarg on github.
  • I am sarg (https://keybase.io/sarg) on keybase.
  • I have a public key whose fingerprint is 09F6 8FC8 0BA0 DC12 5CA7 C490 3ADB 423B 40A2 0785

To claim this, I am signing this object:

@sarg
sarg / notify-tg.sh
Last active January 23, 2018 01:13
notify-tg for ssh
#!/bin/bash
# 0. prerequisites:
# register bot and get access token
# message /newbot to @BotFather
# enter bot name
# save token received from @BotFather
# send message to your newly created bot
# find out chat_id with
# curl -s https://api.telegram.org/bot${TOKEN}/getUpdates \
@sarg
sarg / README.md
Last active May 25, 2024 17:04
rk30xx loader image unpacker

Obtaining RK3066 boot ROM.

Here are my steps.

At first, I took a look to RK30xxLoader(L)_V1.18.bin. This file appears in update.img for my device. So, I unpacked update.img using rk29Kitchen.

strings on that file returns nothing interesting, so I assumed the file is crypted