Skip to content

Instantly share code, notes, and snippets.

View RushOnline's full-sized avatar

Eugene RushOnline

  • Intech
  • Great Novgorod, Russia
View GitHub Profile
@RushOnline
RushOnline / remove-old-kernels.sh
Created October 18, 2017 13:42
Remove old Ubuntu kernels
#!/bin/sh
FRESH_KERNEL=$(ls -1 /boot/vmlinuz-*-generic | tail -n1 | egrep -o '[0-9]+.*')
dpkg -l linux-{image,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(uname -r | cut -d- -f-2) | grep -v $FRESH_KERNEL | xargs apt -y purge
@RushOnline
RushOnline / dmesg
Last active May 21, 2018 10:41
set comfortable dmesg args as defaults
#!/bin/sh
#
# put this file as /usr/local/bin/dmesg and make executable
#
if [ -n "$@" ]; then
/bin/dmesg $@
else
/bin/dmesg -ukxTw
fi
#!/bin/sh
set -e
FB="fastboot -S 512M"
#adb reboot bootloader
# Boot TWRP recovery
#${FB} oem unlock
#!/bin/bash
OPTIONS="Centered Scaled Spanned Zoom Stretched Wallpaper Quit"
select opt in $OPTIONS; do
if [ "$opt" = "Centered" ]; then
gsettings set org.gnome.desktop.background picture-options "centered"
echo You choose the background-picture to be $opt ! | tr '[A-Z]' '[a-z]'
elif [ "$opt" = "Scaled" ]; then
gsettings set org.gnome.desktop.background picture-options "scaled"
echo You choose the background-picture to be $opt ! | tr '[A-Z]' '[a-z]'
@RushOnline
RushOnline / list.h
Created December 5, 2016 17:28 — forked from evanslai/list.h
Linux kernel linked list, modified for userspace
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
#include <stdio.h>
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
Setup RaspberryPi:
mkdir -p /etc/ppp/scripts
cat > /etc/ppp/scripts/ppplogin <<EOF
#!/bin/sh
# ppplogin - script to fire up pppd on login
# Disable other users to write to the tty.
mesg n
; in the name of ALLAH
; /etc/systemd/system/stunnel.service or /usr/lib/systemd/system/stunnel.service
; change "{{ config.conf }}" by your config path.
[Unit]
Description=SSL tunnel for network daemons
After=syslog.target
[Service]
ExecStart=/usr/sbin/stunnel {{ config.conf }}
# article http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/
# clone of https://github.com/borromeotlhs/node-opencv/blob/77e72273608387957340abe1f6a1a4608173fed1/Dockerfile
# This file describes how to build node-opencv into a runnable linux container with all dependencies installed
# To build:
# 1) Install docker (http://docker.io)
# 2) Build: wget https://raw.github.com/dotcloud/docker/v0.1.6/contrib/docker-build/docker-build && python docker-build $USER/node-opencv < Dockerfile
# 3) Test: docker run $USER/node-opencv node -e "console.log(require('opencv').version)"
#
# VERSION 0.3
# DOCKER-VERSION 8.1.2
@RushOnline
RushOnline / qtyaml.h
Created February 20, 2016 09:03 — forked from brcha/qtyaml.h
Qt Yaml support using yaml-cpp library
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* ***** END LICENSE BLOCK ***** */
/*
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.6 (GNU/Linux)
mQGiBEK/0MURBACv5Rm/jRnrbyocW5t43hrjFxlw/DPLTWiA16apk3P2HQQ8F6cs
EY/gmNmUf4U8KB6ncxdye/ostSBFJmVYh0YEYUxBSYM6ZFui3teVRxxXqN921jU2
GbbWGqqlxbDqvBxDEG95pA9oSiFYalVfjxVv0hrcrAHQDW5DL2b8l48kGwCgnxs1
iO7Z/5KRalKSJqKx70TVIUkD/2YkkHjcwp4Nt1pPlKxLaFp41cnCEGMEZVsNIQuJ
1SgHyMHKBzMWkD7QHqAeW3Sa9CDAJKoVPHZK99puF8etyUpC/HfmOIF6jwGpfG5A
S7YbqHX6vitRlQt1b1aq5K83J8Y0+8WmjZmCQY6+y2KHOPP+zHWKe5TJDeqDnN0j
sZsKA/441IF4JJTPEhvRFsPJO5WKg1zGFbxRPKvgi7+YY6pJ0VFbOMcJVMkvSZ2w