Skip to content

Instantly share code, notes, and snippets.

@rubo77
rubo77 / print_current_color.sh
Last active April 9, 2024 22:33
defines a set of colors, interpolates between them to create a smooth gradient and then changes the keyboard backlight color to match the current time
#!/bin/bash
# defines a set of colors, interpolates between them to create a smooth gradient
# and then changes the keyboard backlight color to match the current time
# uses https://github.com/wroberts/rogauracore
# options for the program: -h=help, -t=test
while getopts ":ht" opt; do
case ${opt} in
h )
@rubo77
rubo77 / download-mozilla-portable.sh
Last active February 22, 2024 06:46
a script that downloads a certain Firefox or Thunderbird version and installs it in an extra folder to create an independent and portable App for Linux. source: http://portableapps.com/node/16344
#!/bin/sh
# Configure the following default variables according to your requirements
language="en-US" # e.g. "de" or "en-US"
if [ ! "$1" ]; then
# default if no argument is set:
version="95.0" # chose from http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/
application="firefox" # "thunderbird" or "firefox" but file extension, archive extraction, and binary
fi
@rubo77
rubo77 / fix_mysql.inc.php.md
Last active December 13, 2023 23:58
A php include that replaces all mysql functions with the corresponding mysqli functions

If you have any questions open an issue there or enhancements as Pull Request

replacement for all mysql functions

Be aware, that this is just a workaround to fix-up some old code and the resulting project will be more vulnerable than if you use the recommended newer mysqli-functions instead. So only If you are sure that this is not setting your server at risk, you can fix your old

@rubo77
rubo77 / rotate-screen.sh
Last active October 9, 2023 11:30
This script rotates the screen and touchscreen input, disables or enbles the touchpad, and dis- or enables the virtual keyboard on a Lenovo Yoga 13 or Yoga 2 Pro (source: http://askubuntu.com/q/405628/34298)
#!/bin/bash
# This script rotates the screen and touchscreen input 90 degrees each time it is called,
# also disables the touchpad, and enables the virtual keyboard accordingly
# by Ruben Barkow: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen and Touchpad device with `xinput`
TouchscreenDevice='ELAN Touchscreen'
TouchpadDevice='SynPS/2 Synaptics TouchPad'
@rubo77
rubo77 / rotatescreen.sh
Last active August 1, 2023 17:16
This script rotates the screen (tested on a Lenovo Yoga 730-15iwl) (source: https://askubuntu.com/a/1217290/34298)
#!/bin/bash
# This script rotates the screen and touchscreen
# by Ruben Barkow-Kuder: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen device with `xinput`
TouchscreenDevice="$(xrandr |grep eDP|cut -d" " -f1)"
if [ "$1" = "--help" ] || [ "$1" = "-h" ] ; then
@rubo77
rubo77 / mount-root
Last active May 25, 2023 08:22
Mounts all needed mount points to change into another system from within a live-CD
#!/bin/bash
# mounts all needed mount points to change into another system from within a live-CD
#-------------- Author: -------------#
# by Ruben Barkow (Rubo77)
if [ "$(whoami &2>/dev/null)" != "root" ] && [ "$(id -un &2>/dev/null)" != "root" ] ; then
echo "You must be root to run this script!"; echo "use 'sudo !!'"; exit 1
fi
@rubo77
rubo77 / snap-update.sh
Last active March 31, 2023 16:46
start snap service, delete snap backups, do a refresh and disable it again
#!/bin/bash
# this script starts the snapd service, deletes old snap images, does a refresh and disables it again
# put it in /usr/local/sbin/snap-update and give it executable rights
# Note: If you run apt upgrade and there is an update to a package that is managed by snapd,
# the upgrade will hang if snapd is still masked, so remember to unmask snapd in that case
# and start apt upgrade again
set -x
systemctl unmask snapd.service
@rubo77
rubo77 / cla.md
Created March 16, 2023 19:05
Eastcoast Laboratories CLA

Eastcoast Laboratories Contributor License Agreement

The document below clarifies the terms under which You (the copyright owner or legal entity authorized by the copyright owner), may make "The Contributions" (software, bug fixes, configuration changes, documentation, or any other materials) to "The Work" (Eastcoast Laboratories). This license protects You, "Eastcoast Laboratories" and licensees; it does not change your rights to use your own contributions for any other purpose.

You and "Eastcoast Laboratories" agree:

• You grant to "Eastcoast Laboratories" a non-exclusive, irrevocable, worldwide, royalty-free, sublicenseable, relicenseable, transferable license under all of Your relevant intellectual property rights, to use, copy, prepare derivative works of, distribute and publicly perform and display "The Contributions" on any licensing terms, including without limitation: (a) open source licenses like the GNU General Public (v2.0) license; and (b) binary, proprietary, or commercial licenses. Except

#!/bin/bash
# This script purges the local history older than 90 days in some rooms, that you can define in an array
#
# crontab -e
# 23 4 * * * bash /home/irc-bridge/.synapse/EIGENE_purge_history_daily > /dev/null 2>&1
cd /home/irc-bridge/.synapse/
DOMAIN="matrix.yourserver.org"
ADMIN="@some_adminuser:matrix.yourserver.org"
@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