Skip to content

Instantly share code, notes, and snippets.

View mrkeuz's full-sized avatar

Mr Keuz mrkeuz

  • Russia, Saint-Petersburg
View GitHub Profile
@mrkeuz
mrkeuz / README.md
Created April 8, 2021 11:06 — forked from plugnburn/README.md
NokiaTool - simple interface Bash script for MediaTek-based Nokia simple phones

NokiaTool: control MediaTek-based Nokia phones from your PC

Overview

NokiaTool is a simple Bash script (nokiatool.sh) that allows you to use an undocumented serial connection in USB-enabled MediaTek-based Nokia feature phones manufactured by Microsoft (even the most basic ones, like the new 105) in order to control them from your PC.

This project is an ongoing work and uses only some bits and pieces of information about the phone internals available to the public, so under any circumstances don't consider it stable or a replacement for official tools if any are present.

@mrkeuz
mrkeuz / linebreak.md
Created April 3, 2021 22:02
Line breaks in markdown
Hello  (<-- two spaces)
World

Hello
World


@mrkeuz
mrkeuz / compare_app_ini.py
Created February 10, 2021 14:14
Check gogs app.ini that keys not DEPRECATED/renamed
#!/usr/bin/env python3
import configparser
from urllib.request import urlopen
def compare():
print("Check configs...")
# Upstream App ini
@mrkeuz
mrkeuz / tmux-cheatsheet.markdown
Created October 26, 2018 16:04 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mrkeuz
mrkeuz / schema.sql
Created April 18, 2018 15:32 — forked from fernandomantoan/schema.sql
Schema for PostgreSQL to use with JdbcTokenStore (Spring Security OAuth2)
create table oauth_client_details (
client_id VARCHAR(256) PRIMARY KEY,
resource_ids VARCHAR(256),
client_secret VARCHAR(256),
scope VARCHAR(256),
authorized_grant_types VARCHAR(256),
web_server_redirect_uri VARCHAR(256),
authorities VARCHAR(256),
access_token_validity INTEGER,
refresh_token_validity INTEGER,
@mrkeuz
mrkeuz / TestObservableExceptions
Created March 1, 2018 14:11
Blocking/Non blocking observable
import io.reactivex.Observable;
import io.reactivex.Single;
import org.junit.Test;
public class TestObservableExceptions {
@Test(expected = Exception.class)
public void throws_exception_from_onNext_onError_blocking1() throws Exception {
Observable
.just(1)
@mrkeuz
mrkeuz / ramdisk.sh
Created November 10, 2016 21:34 — forked from rxin/ramdisk.sh
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
@mrkeuz
mrkeuz / ipv6-regex-test.sh
Created May 4, 2016 21:26 — forked from syzdek/ipv6-regex-test.sh
Simple script to test my IPv6 regular expression.
#!/bin/sh
#
# Use posixregex CLI tool from: https://github.com/syzdek/dmstools/blob/master/src/posixregex.c
RE_IPV4="((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])"
posixregex -r "^(${RE_IPV4})$" \
127.0.0.1 \
10.0.0.1 \
192.168.1.1 \
@mrkeuz
mrkeuz / idletime.sh
Created April 18, 2016 23:34 — forked from Neil-Smithline/idletime.sh
Mac OS X Idle Time Shell Script
#!/bin/sh
# Get MacOSX idletime. Shamelessly stolen from http://bit.ly/yVhc5H
/usr/sbin/ioreg -c IOHIDSystem | /usr/bin/awk '/HIDIdleTime/ {print int($NF/1000000000); exit}'
@mrkeuz
mrkeuz / homebrew-github-api-token.md
Created April 1, 2016 11:18 — forked from christopheranderton/homebrew-github-api-token.md
Set your Github API Token If you hit a ”GitHub API rate limit exceeded” when searching with Homebrew (http://brew.sh/).

Description

When using Homebrew (http://brew.sh) and searching formulas or pull requests you may get the dreaded error message: Github API Rate limit exceeded

Let's fix that! (yeah!)


Short version

Create a new Personal Token in your Github Account Settings (Sidebar: Applications) and then copy the Token. In the Terminal, use export HOMEBREW_GITHUB_API_TOKEN=YOURAPITOKENWITHFUNKYNUMBERSHERE (change that to your API Token) or add that to your .bash_profile and then do source .bash_profile.