Skip to content

Instantly share code, notes, and snippets.

View sattellite's full-sized avatar
⌨️
Just pushing buttons

sattellite sattellite

⌨️
Just pushing buttons
View GitHub Profile
@sattellite
sattellite / goroot-update
Created May 31, 2022 13:13
Create single GOROOT on MacOS with golang installed with brew
#!/bin/bash
src=$(go env GOROOT)
dst=$(brew --prefix)/Cellar/go/libexec
dst_link=$(readlink -f ${dst})
if [ $? -ne 0 ]; then
echo "Create GOROOT symlink to latest go version"
echo "${src} -> ${dst}"
@sattellite
sattellite / go-update
Last active April 14, 2022 12:53
Updating golang to latest version
#!/bin/bash
# Binaries for golang will be placed in /usr/local/go
# And /usr/local/go/bin must be in PATH
# Put 'export PATH="${PATH}:/usr/local/go/bin"' in shell config
# Go version before update
go version
# Parse url to latest archive for linux
fileurl=$(curl -sL https://go.dev/dl/ | egrep 'downloadBox.*linux-amd64' | head -1 | sed -e 's#^.*\(/dl/.*\.tar\.gz\).*#https://golang.org\1#')
@sattellite
sattellite / git-sync
Last active August 14, 2019 11:49
Syncing local repo with remote
#!/bin/bash
# Put this file to $PATH and then call it `git sync`
set -e
LANG=C
NC='\033[0m'
RED="${NC}\033[0;31m"
YLW="${NC}\033[1;33m"
WHI="${NC}\033[1;37m"
GRN="${NC}\033[1;32m"
@sattellite
sattellite / pre-commit
Created December 25, 2014 14:15
Git pre-commit hook for versioning
#!/usr/bin/zsh
VERFILE=lib/Data.pm
if (git diff --cached --diff-filter=M --unified=0 $VERFILE|grep VERSION 1>/dev/null)
then
exit 0
else
cat <<\EOF
@sattellite
sattellite / update-git.sh
Last active August 29, 2015 14:10
Update git to latest stable version in Fedora
#!/bin/bash
CUR_PWD=`pwd`
TEMPPATH=${HOME}/.tmp
GITDIR=${TEMPPATH}/git
function clone_git {
git clone https://github.com/git/git.git $GITDIR &>/dev/null
}
@sattellite
sattellite / tau8_config.pl
Last active August 29, 2015 14:04
Script for create configuration archives for Eltex TAU-8.IP
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
use File::Copy 'move';
use File::Copy::Recursive 'dircopy';
$\="\n";
my $temp = '/usr/local/share/eltex/temporary/';
my $template = '/usr/local/share/eltex/template/';
@sattellite
sattellite / sublime-text-3.sh
Last active May 26, 2016 09:01 — forked from henriquemoody/sublime-text-2.sh
Install new version of Sublime Text 3
#!/usr/bin/env bash
# Usage: {script} [ OPTIONS ]
#
# OPTIONS
#
# -h, --help Displays this help message.
# -t, --type Default type is "dev". Values is "stable" and "dev".
# -b, --build Version of Sublime Text 3. If not defined tries to get the
# build into the Sublime Text 3 website.
# --target Default target is "/usr/local".
@sattellite
sattellite / redis-deb.sh
Last active August 29, 2015 13:56 — forked from jedi4ever/gist:944216
Create deb for redis
VERSION=2.8.5
apt-get -y install wget
rm -rf redis-$VERSION
wget http://download.redis.io/releases/redis-$VERSION.tar.gz
tar -xzvf redis-$VERSION.tar.gz
cd redis-$VERSION
./configure --prefix=/usr
make
rm -rf /tmp/redis-$VERSION.$$
mkdir /tmp/redis-$VERSION.$$

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sattellite
sattellite / WoT API
Created August 19, 2013 19:47 — forked from bartku/gist:2419852
World of Tanks API. replace eu to ru and it will work with russian servers.
Searching players:
http://worldoftanks.eu/community/accounts/api/%API_VER%/?source_token=%TOKEN%&search=%NAME%&offset=0&limit=1
Showing player's stats:
http://worldoftanks.eu/community/accounts/%PLAYER_ID%/api/%API_VER%/?source_token=%TOKEN%
Showing player's stats from past:
http://dava2.worldoftanks.com/userstats/2/stats/slice/?platform=android&server=eu&account_id=%PLAYER_ID%&hours_ago=24&hours_ago=168&hours_ago=336