Skip to content

Instantly share code, notes, and snippets.

@dirkakrid
dirkakrid / README.md
Created October 30, 2016 01:14 — forked from abhishekkr/editor-bookmarklet.md
in browser editor ~ save them as link of bookmark

Use of each:

  • notepad : is a bit tweaked console-color notepad available in browser via bookmark

  • markdown-editor-need-www : live-preview markdown editor; does GET 2 Markdown JS files online

  • live-preview-markdown-editor-offline : will give a pure offline live-preview markdown editor

These will work directly by copy/pasting the content in Browser URL and pressing "Enter". Then you can bookmark it on render with proper name and use whenever want.

#!/usr/bin/env bash
# Download HTML converted from provided Markdown, using GitHub API v3
##
md2html(){
if [[ $# -ne 2 ]]; then
echo "ERROR.\nSYNTAX: Markdown_To_HTML <markdown-filepath> <dest-html-filepath>"
return
fi
unset _markdown_filepath
#!/bin/bash
# And now we cry because --network-interface on systemd-nspawn is broken. :(
set -e
NAME="$1"
shift
for retry in {1..5}; do
if machinectl status "$NAME" &>/dev/null; then
@dirkakrid
dirkakrid / systemd-ubuntu.md
Created October 30, 2016 03:30 — forked from webwurst/systemd-ubuntu.md
systemd-ubuntu
@dirkakrid
dirkakrid / 0-image.sh
Created October 30, 2016 04:02 — forked from gdamjan/0-image.sh
grub imagelet to start VMs from an image without bootloader
# Create the grub boot image
grub-mkimage -O i386-pc -o grub.img -c grub.cfg \
at_keyboard configfile biosdisk ext2 linux test serial halt minicmd terminal cat acpi
# to create the unbootable linux image, no partitions
qemu-img create -f qcow2 unbootable.img 10G
sudo modprobe nbd max_part=16
sudo qemu-nbd -c /dev/nbd0 unbootable.img
sudo mkfs.ext4 -L ROOT /dev/nbd0
@dirkakrid
dirkakrid / pyside_webkit_javascript.py
Created October 31, 2016 04:16 — forked from webwurst/pyside_webkit_javascript.py
PySide/WebKit/Javascript
import sys
from PySide.QtCore import QObject, Slot
from PySide.QtGui import QApplication
from PySide.QtWebKit import QWebView
html = """
<html>
<body>
<h1>Hello!</h1><br>
@dirkakrid
dirkakrid / syslog_server.py
Created October 31, 2016 07:26 — forked from arnobroekhof/syslog_server.py
syslog_server.py
#!/usr/bin/env python
##
## This is a syslog server that is able to receive UDP based syslog
LOG = 'thelogfile.log'
HOST, PORT = "0.0.0.0", 514
import logging
@dirkakrid
dirkakrid / parse_logfile
Created October 31, 2016 07:31 — forked from arnobroekhof/parse_logfile
Parsing log file
#!/usr/bin/env python
#
# log_format traffic '$http_host|$status|$bytes_sent|$msec|$remote_addr|$request_uri';
import sys
import itertools, operator
from datetime import datetime
access_log = '/var/log/nginx/access.log'
#!/bin/sh
systemctl stop docker.service
rm $(which docker)
rm /var/run/docker.pid
curl -fsSL https://github.com/armhf-docker-library/binaries/releases/download/1.10.1/docker-1.10.1 \
-o /usr/bin/docker
chmod u+x /usr/bin/docker
@dirkakrid
dirkakrid / uncipher.py
Created November 25, 2016 06:15 — forked from jayswan/uncipher.py
Python: reverse Cisco type 7 passwords with input from argument
"""
Uncipher Cisco type 7 ciphered passwords
Usage: python uncipher.py <pass> where <pass> is the text of the type 7 password
Example:
$ python uncipher.py 094F4F1D1A0403
catcat
"""
import sys