Skip to content

Instantly share code, notes, and snippets.

[Unit]
Description=deletes all but the last 1000 lines of syslog due to possible logging spam by VLC
[Service]
Type=oneshot
ExecStart=-/usr/local/sbin/truncate_syslog.sh
TimeoutSec=0
StandardOutput=syslog
After=suspend.target
@rubo77
rubo77 / MainActivity.java
Last active May 7, 2019 13:16 — forked from sandeepyohans/MainActivity.java
Adding alert() support to a WebView - Android
/*
Retrieved from https://web.archive.org/web/20160516165158/http://lexandera.com/2009/01/adding-alert-support-to-a-webview/
*/
// ...
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
public class MainActivity extends AppCompatActivity {
@rubo77
rubo77 / sourceforge.to.github.impor.markdown
Last active December 27, 2022 11:29 — forked from binarytemple/sourceforge.to.github.impor.markdown
import a sourceforge project (with full history) to github

In order to clone the timeeffect application from sourceforge to github I performed the following steps.

rsync -av rsync://a.cvs.sourceforge.net/cvsroot/timeeffect/\* cvs
svn export --username=guest http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk
cp ./cvs2svn-trunk/cvs2git-example.options ./cvs2git.options
vim cvs2git.options # edit run_options.set_project
cvs2svn-trunk/cvs2git --options=cvs2git.options --fallback-encoding utf-8
#create at https://github.com/rubo77/timeeffect.git
git clone git@github.com:rubo77/timeeffect.git timeeffect-github
@rubo77
rubo77 / solve.md
Created August 11, 2018 16:39 — forked from leolin310148/solve.md
solve "error initializing graphdriver: loopback attach failed" for docker-in-docker

Create loopback.sh in tmp

#!/bin/bash
ensure_loop(){
  num="$1"
  dev="/dev/loop$num"
  if test -b "$dev"; then
    echo "$dev is a usable loop device."
 return 0
@rubo77
rubo77 / Compile to .deb
Last active November 13, 2018 16:34 — forked from Avyd/Compile to .deb
Compile kernel to installable .deb package
# Install necessary things
apt-get update
apt-get install --no-install-recommends kernel-package libncurses5-dev fakeroot wget bzip2 build-essential bison
# Get the kernel
cd /usr/src
# search latest kernel on https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/
VERSION=4.18.6
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-$VERSION.tar.xz
wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-$VERSION.tar.sign
@rubo77
rubo77 / create-gist.sh
Last active August 30, 2020 09:41 — forked from s-leroux/pgist.sh
A utility to create a gists from command line - for support, please check the repo https://github.com/ceremcem/create-gist
#!/bin/bash
GITHUB_USERNAME=rubo77
if [ "$1" == "" ]; then
echo 'usage: gistfile-post.sh filename [gistname]'
exit 0
fi
# 0. file name for the Gist
@rubo77
rubo77 / SimpleAuthServer.py
Created January 29, 2016 00:50 — forked from fxsjy/SimpleAuthServer.py
SimpleAuthServer: A SimpleHTTPServer with authentication
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import base64
key = ""
class AuthHandler(SimpleHTTPRequestHandler):
''' Main class to present webpages and authentication. '''
def do_HEAD(self):
@rubo77
rubo77 / ipv6-httpd.py
Created November 24, 2015 12:56 — forked from akorobov/ipv6-httpd.py
quick ipv6 http server using python's SimpleHttpServer
import socket
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
class MyHandler(SimpleHTTPRequestHandler):
def do_GET(self):
if self.path == '/ip':
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
@rubo77
rubo77 / Packet types
Last active July 3, 2018 07:25 — forked from tcatm/Packet types
Konzept für ein verteiltes DHCP im Mesh
required types
--------------
- [X] Block allocation/freeing/delegation
- [ ] request for block owner
- [ ] lease renewal (proxy)
- [ ] lease renewal response (proxy)
Allocate Block
@rubo77
rubo77 / firmware.html
Last active September 9, 2015 07:39 — forked from neocturne/firmware.html
---
layout: base
---
<div class="heading">
<div class="row">
<div class="twelve columns">
<h1>Firmware</h1>
</div>
</div>