Skip to content

Instantly share code, notes, and snippets.

@geakstr
geakstr / AVLSet.java
Last active December 26, 2015 21:09
Set Implementation on AVL-tree
public class AVLSet<T extends Comparable<T>> implements Iterable<T> {
private Node<T> root;
private int size;
private boolean desc_order;
public AVLSet() {
this(false);
}
@geakstr
geakstr / systat
Last active January 2, 2016 14:49
Raspberry PI current system info
#!/bin/bash
# systat — Raspberry PI current system info
# For work vcgencmd maybe you should does this actions:
# sudo -i
# usermod -a -G video you_user
# ln -s /opt/vc/bin/vcgencmd /usr/bin/vcgencmd
# echo 'SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"' > /etc/udev/rules.d/10-vchiq-permissions.rules
# exit
@geakstr
geakstr / i2t
Created January 8, 2014 16:30
Install Tesseract OCR and bash script for using
sudo apt-get install \
imagemagick libpng12-dev libjpeg8-dev libtiff4-dev bc \
libtesseract-dev libtesseract3 tesseract-ocr tesseract-ocr-equ \
tesseract-ocr-equ tesseract-ocr-osd tesseract-ocr-osd \
tesseract-ocr-eng tesseract-ocr-rus
touch i2t
chmod +x i2t
nano i2t
@geakstr
geakstr / settings.json
Created January 10, 2014 21:27
Config for Transmission. Optimized for Raspberry Pi. Do not forget to change password, paths and maybe other parameters.
{
"alt-speed-down": 50,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
@geakstr
geakstr / oh-my-theme.zsh-theme
Last active January 4, 2016 14:09
Theme for ZSH
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
local ret_status="%(?:%{$fg_bold[green]%}%(!.#.>) :%{$fg_bold[red]%}%(!.#.>) %s)"
PROMPT='%{$fg[$NCOLOR]%}%n%{$reset_color%}@%{$fg[cyan]%}%m\
%{$reset_color%} %{$fg[magenta]%}%~\
$(git_prompt_info) \
${ret_status}%{$reset_color%} '
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
@geakstr
geakstr / install_zsh
Last active January 4, 2016 14:09
Compile and install ZSH and Oh My ZSH
#!/bin/bash
# Run: ./install_zsh username
username=$1
export ZHS_OH_MY_ZSH_URL=https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh &&
export ZSH_OH_MY_THEME_URL=https://gist.github.com/geakstr/8632148/raw/1ff4feb98a43e4802e5d55973cfa6d8a5a73fc74/oh-my-theme.zsh-theme &&
export ZSH_DOWNLOAD_VERSION=5.0.5 &&
cd /tmp &&
sudo aptitude install ncurses-dev &&
@geakstr
geakstr / gist:a8486d563d99d8e2e421
Last active July 29, 2020 03:24
Setting up raspberry pi
# Initial updates and necessary tools
aptitude update && aptitude full-upgrade && \
aptitude install gcc gcc-4.4 gcc-4.5 gcc-4.6 gcc-4.7 git-core binutils curl \
bcc psmisc htop hdparm cpufrequtils screen autoconf \
make texinfo bc build-essential bzip2 libbz2-dev \
zlib1g-dev libssl-dev libreadline6 libreadline6-dev \
sqlite3 libsqlite3-dev ncurses-dev sudo \
libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev
@geakstr
geakstr / upd_ya_pdd.sh
Last active May 30, 2018 14:58
Update IP for "A" record in Yandex PDD through API
#!/bin/bash
# Get your token from
# https://pddimp.yandex.ru/token/index.xml?domain=yourdomain.com
token="put token"
# Get DNS information from
# https://pddimp.yandex.ru/nsapi/get_domain_records.xml?token=your_token_here&domain=yourdomain.com
record_id="put record id from 'id' attr"
#!/usr/bin/env bash
# names of latest versions of each package
export VERSION_PCRE=pcre-8.36
export VERSION_OPENSSL=openssl-1.0.1k
export VERSION_NGINX=nginx-1.7.9
# URLs to the source directories for each package
export SOURCE_OPENSSL=https://www.openssl.org/source/
export SOURCE_PCRE=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
@geakstr
geakstr / LICENSE.txt
Last active August 29, 2015 14:21 — forked from podefr/LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Olivier Scherrer
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE