Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
chmod 700 ~/.ssh
chmod 600 ~/.ssh/* # for private keys
chmod 644 ~/.ssh/*.pub # for public keys
chmod 644 ~/.ssh/known_hosts
chmod 600 ~/.ssh/authorized_keys
chmod 600 ~/.ssh/config
@helix84
helix84 / .odbc.ini
Created August 20, 2018 15:00 — forked from lbolla/.odbc.ini
[MyDB]
Description = My Database
Driver = FreeTDS
Servername = W7WS6CL832J # MSSQL server name
Database = mydb
UID = username
PWD = password
Port = 1433
Charset = UTF-8
#!/bin/bash
#
# Usage: potouch.sh *.po
# in all files given as arguments (Gettext .po files),
# change the time in the PO-Revision-Date header to current time
# modifies the specified files in place
now=`date +"%F %H:%M%z"`
sed -i "s/PO-Revision-Date: .*\\\\n/PO-Revision-Date: $now\\\\n/" "$@"
#!/bin/sh
#
# Author: Ivan Masar, 2015
# License: public domain
#
# list running VMs by name
# for each VM print selected fields from vminfo
# format it into a table (using "column")
print_header=1
#!/bin/sh
#
# colorize DSpace CSV import output (diff) using ANSI sequences for viewing in the terminal
# colorize added and removed values (green and grey)
# mark errorneous or suspicious values or characters (red background)
#
# Usage:
# /dspace/bin/dspace metadata-import -e dspaceadmin@example.com -f import.csv | tee ~/changes/2016-09-06.txt | ~/bin/colorize-import.sh | less -R
# or
# ~/bin/colorize-import.sh ~/changes/2016-09-06.txt
@helix84
helix84 / compiled_file_python_version.py
Last active July 28, 2016 21:48 — forked from delimitry/compiled_file_python_version.py
Get the version of Python by which the file was compiled
#!/usr/bin/env python
# -*- coding: utf8 -*-
import os
import sys
import struct
magics = {
20121: 'Python 1.5.x',
50428: 'Python 1.6',
@helix84
helix84 / VBOX_E_INVALID_VM_STATE.md
Created June 20, 2016 14:37 — forked from hsiboy/VBOX_E_INVALID_VM_STATE.md
rescue a VM from VBOX_E_INVALID_OBJECT_STATE

#Issue

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Clearing any previously set forwarded ports...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
watch
watch -d
rlwrap
rlwrap nc localhost 80
procedure ShowText(Canvas: TCanvas; Text: string)
var
LogFont: TLogFont;
begin
GetObject(Canvas.Font.Handle, SizeOf(LogFont), Addr(LogFont));
with LogFont do
begin
lfQuality := ANTIALIASED_QUALITY;
lfOutPrecision := Out_TT_Only_Precis;
end;
# this list is not exhaustive
sed \
-e 's/\\u00c4\\u00be/ľ/g' \
-e 's/\\u00c5\\u00a1/š/g' \
-e 's/\\u00c4\\u008d/č/g' \
-e 's/\\u00c5\\u00a5/ť/g' \
-e 's/\\u00c3\\u00a4/ť/g' \
-e 's/\\u00c5\\u00be/ž/g' \
-e 's/\\u00c3\\u00bd/ý/g' \
-e 's/\\u00c3\\u00a1/á/g' \