Skip to content

Instantly share code, notes, and snippets.

View vodolaz095's full-sized avatar

Остроумов Анатолий vodolaz095

View GitHub Profile
@vodolaz095
vodolaz095 / strings_test.go
Last active June 26, 2022 21:29
golang benchmark of string concatenation
package strings
import (
"bytes"
"fmt"
"os"
"strings"
"testing"
)
@vodolaz095
vodolaz095 / install.sh
Created December 15, 2018 13:47
basicFedoraSetup4Development.sh
#!/usr/bin/env bash
# upgrade system
su -c 'dnf upgrade -y'
# install extra repos
su -c 'dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm'
su -c 'dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm'
su -c 'dnf upgrade -y rpmfusion-free-release rpmfusion-nonfree-release'
@vodolaz095
vodolaz095 / screenshot
Created November 18, 2018 08:02
screenshot - shell script to make and upload screenshot
#!/bin/bash
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 9 | head -n 1)
PIC_URL=$HOME/Pictures/Screenshots/$NEW_UUID.png
mkdir -p $HOME/Pictures/Screenshots
scrot -s -c $PIC_URL
scp $PIC_URL holod.local:/srv/www/s/
+ check_common_commands http://example.com
+ '[' 1 -gt 0 ']'
+ parm=http://example.com
+ shift
+ case "$parm" in
+ '[' 0 -gt 0 ']'
+ '[' -z '' ']'
+ unset XDG_UTILS_DEBUG_LEVEL
+ '[' 0 -lt 1 ']'
+ xdg_redirect_output=' > /dev/null 2> /dev/null'
@vodolaz095
vodolaz095 / main.go
Created May 20, 2017 11:17
Example of how to host telegram bot on heroky
package main
import (
"gopkg.in/telegram-bot-api.v4"
"log"
"net/http"
"os"
)
func main() {
@vodolaz095
vodolaz095 / guimessage.sh
Created December 4, 2016 09:58
Send message to users desctop using notify-send from remote console via SSH
#!/bin/bash
DISPLAY=:0.0 /bin/notify-send "$1"
@vodolaz095
vodolaz095 / authorized_keys
Created October 22, 2016 10:28
Authorized keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAcHKLMrD4T0N9aKruHTiAhmT2vO8KVByeFWPFvQ+50ZGeuQ9A0eKG8hZdvMsIKH7Xb0w5peTUoeI7xKQP1p6oqVZvXQLsqMdtIewkSMEESMDczl3embt+khxGozAWqQ1+c6zqEKwpCH04RK5Cp7pPYS+AHBx8i/KEVVxmrge+VpchuVNS9Yu9Hcl8H4/eE/tiWGLXi29mNQJ4egGmD0NsIu5mF0aWaFhumyupQZkEVlR/ShkDjoiG0LWcLlO65parePD3TsNhkh034+WaIVtj5T5tt13GiOGo/w5XKFiz3Mm+MxRVYKeg1CEXSACgu3MlNR6yFZgkDYElw6qAZZp1 vodolaz095@snow.local
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDumbiY/euFsYCD+l2bOcle18HS0X45zx2YH5eIHIQxIAWrJxIbEYYVg74JqSABw5h+/mUhocDe3PTskmXUQ9d7Z0YA2GyEAL+m85jXhP5zRoA9Gz5CBL4Rko0Uz5uA9ET868Gnx5J8R1tjSWYEsz9hEbTmXn9ermS03fasw8U53g9cfY197eSqP2Os+BioSPkuJbF8i164NW9i7IgCtTVyBWQWXq5q5wZyDQL5qAc12qlofTE/s7OLynS1/Iwx07G0z6bd0Pz1wscFqnKI7WRnho8rwsed5/Cni3p0r/nvnB2eBH6ktNoWplj9h09G76knjZvgvHdDpTi78KdSH7d vodolaz095@steel.local
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAtX0e7ey1x1PBsQbEGX9/0Avwah45Xd9cVfEo9xNuCYbMNptYL3ki/FVjRXzrtz8YEkUHGoNJ2bpcaeNm/RdGMK2vZw6FoZwsMN2ZFGrF42gWt0TYOXWVAfww2r0HNn3cvILxoRwEkZn5SivRTGRIZ6ego8AEUVKN/yx6EGQRMPvk8xDia
@vodolaz095
vodolaz095 / topten.sh
Created October 12, 2016 01:34
Show top 10 Shell commands you are using
#/bin/sh
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
@vodolaz095
vodolaz095 / decodeViberMessages.sh
Created September 10, 2016 17:42
Decode viber messages
#!/bin/bash
unzip Viber\ messages.zip
find . -name "*.CSV" -exec iconv -c -f UCS-2 -t UTF-8 {} -o {}.txt \;
@vodolaz095
vodolaz095 / go-skype.go
Last active August 1, 2016 22:06
go-skype.go
package main
// Accessing last 10 messages in Skype using Golang.
//HOW TO RUN this application:
// 1. Install Go - https://golang.org/doc/install.
// 2. Instal dependencies by running in console
// go get github.com/jinzhu/gorm