Skip to content

Instantly share code, notes, and snippets.

@97-109-107
97-109-107 / openrct-scr.sh
Created July 10, 2016 15:54
Creates openrct2 scenario screenshots
#!/bin/sh
find ~/.config/OpenRCT2/Scenarios/ -iname "*sc6" -print0 | while IFS= read -r -d '' path; do
name=$(basename "$path")
$(openrct2 screenshot "$path" /tmp/Scenarios/"$name".png 1024 1024 0 50 3 0)
done
@97-109-107
97-109-107 / tile-setter.sh
Last active March 31, 2023 22:46
Aids in setting stupid tiles as X11 background; tints and tiles;
#!/bin/sh
# ██ ██ ██ ██ ██
# ░██ ░░ ░██ ░██ ░██
# ██████ ██ ░██ █████ ██████ █████ ██████ ██████ █████ ██████
# ░░░██░ ░██ ░██ ██░░░██ █████ ██░░░░ ██░░░██░░░██░ ░░░██░ ██░░░██░░██░░█
# ░██ ░██ ░██░███████░░░░░ ░░█████ ░███████ ░██ ░██ ░███████ ░██ ░
# ░██ ░██ ░██░██░░░░ ░░░░░██░██░░░░ ░██ ░██ ░██░░░░ ░██
# ░░██ ░██ ███░░██████ ██████ ░░██████ ░░██ ░░██ ░░██████░███
# ░░ ░░ ░░░ ░░░░░░ ░░░░░░ ░░░░░░ ░░ ░░ ░░░░░░ ░░░
# Aids in setting stupid tiles as X11 background; tints and tiles;
*background: #1e2132
*foreground: #c6c8d1
! black
*color0: #2a3158
*color8: #444b71
! red
*color1: #e27878
*color9: #e2a478
! green
*color2: #89b8c2
#!/bin/bash
i3-msg -t get_workspaces | jq -r 'map(select(.focused))[0].rect["width","height"]'
i3-msg -t get_workspaces | jq -r 'map(select(.focused))[0].output'
@97-109-107
97-109-107 / i3-get-current-screen.py
Last active September 19, 2019 15:46
get the size of current screen in i3wm
#!/usr/bin/env python
import i3
def getCurrentScreen():
workspace = [ws for ws in i3.get_workspaces() if ws['focused']][0]
screen_w =str(workspace['rect']['width'])
screen_h =str(workspace['rect']['height'])
print(screen_w, screen_h);
@97-109-107
97-109-107 / vim_cterm2gui.py
Created June 23, 2015 08:22
convert from ctermfg/ctermbg to guifg/guibg
#!/usr/bin/env python2.7
#based on https://gist.github.com/hhatto/6405956 from hhato
import sys
new_vim_color = []
xtermMap = {
'0': '#000000', '1': '#800000', '2': '#008000', '3': '#808000', '4': '#000080',
'5': '#800080', '6': '#008080', '7': '#c0c0c0', '8': '#808080', '9': '#ff0000',
'10': '#00ff00', '11': '#ffff00', '12': '#0000ff', '13': '#ff00ff', '14': '#00ffff',
@97-109-107
97-109-107 / prepareXcolors.rb
Created April 19, 2015 15:56
This script parses xcolor-type files to the format supported by dynamic-colors https://github.com/sos4nt/dynamic-colors
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-.
require 'pathname'
# This script parses xcolor-type files to the format supported by dynamic-colors
# https://github.com/sos4nt/dynamic-colors
@xcolorsDirPath = ENV['HOME']+'/.config/themer/schemes/'
@destinationFolder = ENV['HOME']+'/.dynamic-colors/colorschemes/'
@97-109-107
97-109-107 / i3-quaketerm-spawn-if.py
Last active April 25, 2019 13:14
This scipt can emulate a drop down terminal behaviour with any kind of emulator (or application). The same can be achieved without an external script, but won't work if you have differently sized workspaced - hence the resize and repositioning calls. The script assumes that the you have a statusbar of 18px height on top of your workspace (see ba…
#!/usr/bin/env python
import i3
import re
import sys
from time import sleep
import json
#resize <grow|shrink> <direction> [<px> px [or <ppt> ppt]]
barHeight = 18
#!/usr/bin/env python
import i3
outputs = i3.get_outputs()
workspaces = i3.get_workspaces()
# figure out what is on, and what is currently on your screen.
workspace = list(filter(lambda s: s['focused']==True, workspaces))
output = list(filter(lambda s: s['active']==True, outputs))

How to install ipkg on a Synology DS214

After a couple of days of trying to get ipkg woking on my DS214 I found this article by trepmag. It is written for the DS213j, but it’s been working for me and others for the DS214 too.

I have done some minor changed to clarify some things, but if you are a Linux guy (unlike me) my changes might be of no use to you.

Guide