Skip to content

Instantly share code, notes, and snippets.

View doromones's full-sized avatar
🚀
per rectum ad astrum

Anton doromones

🚀
per rectum ad astrum
  • Starladder
  • Ukraine, Kiev
  • 09:12 (UTC +02:00)
View GitHub Profile
@doromones
doromones / merged
Last active May 17, 2019 16:20
merged sqoshed branches
#!/bin/bash
currentBranch=$(git rev-parse --abbrev-ref HEAD)
git for-each-ref refs/heads/ "--format=%(refname:short)" | while read branch; do mergeBase=$(git merge-base $currentBranch $branch) && [[ $(git cherry $currentBranch $(git commit-tree $(git rev-parse $branch^{tree}) -p $mergeBase -m _)) == "-"* ]] && echo "$branch"; done
create table a(id integer);
create table b(a_id integer, c_id integer);
create table c(id integer);
insert into a(id) values(1);
insert into a(id) values(2);
insert into a(id) values(3);
insert into c(id) values(1);
insert into c(id) values(2);
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
@doromones
doromones / proxy8080.conf
Created September 16, 2018 17:44
nginx proxy to port 8080
server {
listen 80;
server_name proxy8080.localhost;
location ~ / {
return 301 https://$host$1$request_uri;
}
}
server {
listen 443 ssl;
tar -cvpzf backup.tar.gz \
--exclude=/backup.tar.gz \
--exclude=/proc \
--exclude=/tmp \
--exclude=/mnt \
--exclude=/dev \
--exclude=/sys \
--exclude=/run \
--exclude=/media \
--exclude=/var \
0 2 * * 3 root timeshift --create --tags D --scripted
@doromones
doromones / bira-custom.zsh-theme
Created August 6, 2018 07:00
oh my zsh. bira custom theme
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
if [[ $UID -eq 0 ]]; then
local user_host='%{$terminfo[bold]$fg[red]%}%n@%m%{$reset_color%}'
local user_symbol='#'
else
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
local user_symbol='$'
@doromones
doromones / .xbindkeysrc
Created June 4, 2018 15:58
/home/user/.xbindkeysrc
###########################
# xbindkeys configuration #
###########################
# play
#"xte 'keydown XF86AudioPlay' 'keyup XF86AudioPlay'"
# m:0x0 + b:7 (mouse)
# prev song
"xte 'key XF86AudioPrev'"
@doromones
doromones / SSL-certs-OSX.md
Created April 4, 2018 09:25 — forked from croxton/SSL-certs-OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@doromones
doromones / ngxdis
Created April 2, 2018 10:21 — forked from fideloper/ngxdis
Nginx scripts for enable and disabling a site. This will create or destroy a symlink between a real config file in /etc/nginx/sites-available and a symlink in /etc/nginx/sites-enabled.
#!/usr/bin/env bash
if [ $EUID -ne 0 ]; then
echo "You must be root: \"sudo ngxdis\""
exit 1
fi
# -z str: Returns True if the length of str is equal to zero.
if [ -z "$1" ]; then
echo "Please choose a site."