Skip to content

Instantly share code, notes, and snippets.

View deseven's full-sized avatar

Ivan Novokhatski deseven

View GitHub Profile
@deseven
deseven / is.zsh-theme
Created September 28, 2015 00:03
zsh theme used in interService
PROMPT='%{$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%}%(!.#.$) '
@deseven
deseven / capsSwitch.sh
Created July 22, 2016 10:34
Simple script to change keyboard layout with indication
# capsSwitch
# depends on keyboardSwitcher and maclight
# to get the list of possible layouts, check `keyboardSwitcher list` output
# to check what layouts you use, check `keyboardSwitcher get` while switching layouts
layout1="U.S."
layout2="Russian - PC"
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
@deseven
deseven / phpbb-external-statistics.py
Last active July 28, 2017 22:15
phpbb-external-statistics
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import urllib2
from retry import retry
try:
from BeautifulSoup import BeautifulSoup
except ImportError:
from bs4 import BeautifulSoup
@deseven
deseven / tomp3
Created October 19, 2017 20:16
Simple script to convert all audio files in current directory to mp3
#!/bin/bash
BLUE='\033[1;34m'
NC='\033[0m'
total=0
current=0
ext=""
read -p "Please enter the extension to convert from [flac]: " ext
@deseven
deseven / jira_issues_check
Last active December 8, 2017 10:39
checks whether the defined JIRA user resolved some issues after previous check and sends a notification to Slack if he did not
#!/bin/bash
# === jira_issues_check ===
# checks whether the defined JIRA user resolved some issues after previous check and sends a notification to Slack if he did not
# depends on jq and curl
# written by deseven, 2017
# http://deseven.info
# notifications language (ru/en)
notificationLang=ru
@deseven
deseven / source_random.c
Last active December 24, 2017 19:53
Randomizing srcip PoC
/*
Copyright (C) 2000 Daniel Ryde
Copyright (C) 2017 deseven <de7@deseven.info>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
@deseven
deseven / varclear.fish
Created December 26, 2019 23:33
removes dupes from fish variable (taken from fish issue #296)
function varclear --description 'Remove duplicates from environment variable'
if test (count $argv) = 1
set -l newvar
set -l count 0
for v in $$argv
if contains -- $v $newvar
set count (math $count+1)
else
set newvar $newvar $v
end
@deseven
deseven / fish_prompt.fish
Last active December 27, 2019 00:18
fish theme used in interService
function fish_prompt --description 'Write out the prompt'
set laststatus $status
if not set -q __fish_prompt_hostname
set -g __fish_prompt_hostname (hostname)
end
set_color -b black
if test $laststatus -eq 0
#printf "[%s$status%s] " (set_color -o green) (set_color normal)
@deseven
deseven / tms-obscure-artists.sh
Last active October 7, 2020 01:22
A simple script that filters the list of artists by checking their last.fm playcount (written for TMS search)
#!/bin/bash
# insert your last.fm api key (can be obtained by creating an app here - https://www.last.fm/api/account/create)
# change output_file and artist_play_limit how you like
# you'll also need to install jq
# USAGE:
# cat artists.txt | ./tms-obscure-artists.sh
lastfm_api_key=""
#!/bin/bash
# === bitbucket_user_commits_check ===
# checks whether there are any commits for user since the last working day
# written by deseven, 2019
# http://deseven.info
# bitbucket base URL
bitbucketURL="https://example.com"