Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# 1) copy this file to target server (you may just use `nano` editor)
# 2) run as ` script-name username password` (starting with space symbol to prevent writing password to bash commands history)
ROOT_UID=0
SUCCESS=0
E_USEREXISTS=70
E_NOTROOT=67
# Run as root, of course. (this might not be necessary, because we have to run the script somehow with root anyway)
@d9k
d9k / pgadmin4.service
Last active December 15, 2018 07:51
/etc/systemd/system/pgadmin4.service
# thx https://karlstoney.com/2017/03/03/docker-containers-as-systemd-services/
[Unit]
Description=Docker pgadmin4
Requires=docker.service
After=docker.service
[Service]
#Restart=always
ExecStartPre=/bin/bash -c "/usr/bin/docker rm -f pgadmin4 || true"
@d9k
d9k / colors.less
Created July 12, 2018 18:08
atom-obsidian-syntax-mod
// These colors are specific to the theme. Do not use in a package!
@very-light-gray: #c5c8c6;
@light-gray: #969896;
@gray: #373b41;
@dark-gray: #282a2e;
@very-dark-gray: #1d1f21;
@cyan: #8abeb7;
@blue: #81a2be;
return function (...)
local result = {}
local args, args_count = {...}, select('#', ...)
for i = 1, args_count do
item = args[i]
if item == nil then
table.insert(result, '')
else
table.insert(result, item)
end
@d9k
d9k / pgadmin4.sh
Created March 15, 2018 10:39
my pgadmin4
#!/bin/bash
set -x
docker run --rm -p 5050:5050 -v /home/d9k/soft/pgadmin4/data_pgadmin:/pgadmin thajeztah/pgadmin4
<?php
# Library https://github.com/mibe/FeedWriter was used
# php 5.3 required!
require_once 'FeedWriter_Lib//Item.php';
require_once 'FeedWriter_Lib//Feed.php';
require_once 'FeedWriter_Lib//RSS2.php';
require_once 'FeedWriter_Lib//InvalidOperationException.php';
@d9k
d9k / # festival ru speech engine fixes
Last active May 25, 2018 00:57
/usr/share/festival/voices/russian/msu_ru_nsh_clunits/festvox/msu_ru_nsh_lexicon.scm hack
see explanation.md
@d9k
d9k / readme.md
Last active August 15, 2017 02:56
Babel compressor for jinja assets compiler (see https://github.com/jaysonsantos/jinja-assets-compressor/issues/51)

Got to work with local node_modules installation.

  1. At your app folder: npm install --save babel-cli babel-preset-es2015 babel-preset-react babel-preset-stage-0
  2. manual run to test babel installation: node_modules/.bin/babel --presets=es2015,stage-0,react

input:

`let a = 5; console.log(a);

@d9k
d9k / random-exercise.lua
Last active December 25, 2016 23:44
random-exersise.lua
#!/usr/bin/env lua
-- needs luacoket module:
-- `sudo luarocks install luasocket`
exercises=[[
отжимания, 5 раз
мостик, 8 секунд
приседания, 5 раз
пресс, 6 раз
подтягивания, 2 раза
======================================================================
Survival Time: 4 days, 11.52 hours.
2016.12.25 06:27
Final Moments:
Dogman Leader grazed Player's upper stomach with a claw.
Dogman attacks Player...and hits!