Skip to content

Instantly share code, notes, and snippets.

View DJviolin's full-sized avatar

István Lantos DJviolin

View GitHub Profile
@DJviolin
DJviolin / videos.awk
Created August 31, 2024 07:08
AWK JSON output example
#!/usr/bin/awk -f
# This AWK script outputs a valid json file. You can convert it to ndjson stripping off some extra work from this script
# How to run this script
# $ awk -f videos.awk videos.csv > videos.json
BEGIN {
print "["
first = 1
}
@DJviolin
DJviolin / MakePowerShellRememberSSHPassphrase.md
Created May 14, 2023 10:02 — forked from danieldogeanu/MakePowerShellRememberSSHPassphrase.md
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
@DJviolin
DJviolin / config-without-default-lanti.rsc
Last active June 6, 2022 15:49
RouterOS configuration script based on defconf
# $ /sys default-configuration print
# $ /export terse file=config-back-default.rsc
# $ /export terse file=config-back-lanti.rsc
# $ /export terse file=config-back-lanti-bridge.rsc
# $ /export terse file=default_RB951G-2HnD-back-lanti.rsc
# $ /import config-without-default-lanti.rsc
# $ /system default-configuration print
# $ /system default-configuration print file=config-20220525-002.rsc
# $ /system reset-configuration no-defaults=yes skip-backup=yes run-after-reset=config-without-default-lanti.rsc
@DJviolin
DJviolin / SIMPLE_SSL_WITH_XAMPP.md
Last active April 21, 2023 19:02
Simple SSL with Xampp

Simple SSL with Xampp

In Xampp there's an out-of-the-box Apache SSL configuration with a pre-installed (although expired) root certificate, which pointing to localhost domain. With a little bit of tweaking and freshly generated certs, we will use this built-in config with some tweaks for future web development. This guide is for Windows environment.

  1. First, visit .\xampp\apache folder and execute makecert.bat. Figure out a password for all pass phrase questions. Hit enter for every default or empty values (these are configured at .\xampp\apache\conf\openssl.cnf file). Make sure you also enter a value for this question: Common Name (e.g. server FQDN or YOUR name) []:. I choose the localhost domain, because this is what the pre-installed cert comes with. I should note that, because how browsers handling cookies, a domain name with a dot (like dev.localhost, or www.localhost) would be better (Explaining .localhost TLD), but for the sake of this tut
@DJviolin
DJviolin / index.js
Created December 13, 2017 14:23
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
const bcrypt = require('bcrypt');
/*
Usage:
bcrypt.hash('test', (val) => {
console.log(`bcrypt.hash() === ${val}`);
#!/usr/bin/env bash
set -e
if [ "$EUID" -ne 0 ]; then
echo "This script uses functionality which requires root privileges"
exit 1
fi
acbuildend () {
export EXIT=$?;
#!/bin/sh
set -e
# create ACI with trusty without actool due to bug https://github.com/coreos/rocket/issues/198
# https://gist.github.com/brosner/dbc092e3024f6a80149b
# $ ./debian-aci-creator.sh
# $ cd /var/lib/container/aci
# $ zcat debian.aci | tree | head
# $ rkt run debian.aci --insecure-options=image --interactive --exec=/bin/bash
@DJviolin
DJviolin / nunjucks.js
Last active March 2, 2018 08:00
Native Nunjucks templating support for Koa v2
/*
USAGE:
import njk from './nunjucks';
// Templating - Must be used before any router
app.use(njk(path.join(__dirname, 'views'), {
extname: '.njk',
noCache: process.env.NODE_ENV !== 'production',
throwOnUndefined: true,
@DJviolin
DJviolin / install.sh
Last active August 3, 2016 21:39
WSL
#!/bin/dash
# Windows folder:
# C:\Users\[user]\AppData\Local\lxss
# Uninstall with keeping root dir
# lxrun /uninstall
# Uninstall completely:
# lxrun /uninstall /full /y
@DJviolin
DJviolin / .vimrc
Last active July 20, 2016 20:20
Configs
" Notes
" Regenerate: :Helptags
"
" :cd C/www/cpp
" :w hello-world.cpp
" :edit hello-world.cpp
"
" :XtermColorTable
"
" Run shell command: :!make