This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
if(!function_exists('curl_init')) { | |
die('cURL not available!'); | |
} | |
// check if there are every required arguments | |
if (count($argv) < 4) { | |
echo('USAGE: ' . $argv[0] . ' <URL> <TOKEN> <ROOM ALIAS|ID>'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!/backup* | |
!/dev/disk/ | |
!/etc/.etckeeper | |
!/etc/.git/ | |
!/etc/aide/.aide.conf.swp | |
!/etc/aide/.aide.conf.swp | |
!/etc/aide/aide.conf.d/00_local_excludes | |
!/etc/ld.so.cache | |
!/etc/lvm/archive | |
!/etc/lvm/backup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SERVER="matrix.mycompany.com" | |
echo -e "\e[97mEnter user you'd like to deactivate\e[0m"; | |
read user | |
if [ "$user" == "" ]; then | |
echo "User required."; | |
exit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# this script can log the quality of fastd-connections to all gateways | |
# it sets only one gateway active at a time and checks the connection. | |
# add this script as cron script to get a statistic over time | |
COMMUNITY_NAME=ffki; | |
GW_PREFIX=vpn | |
GATEWAYLIST="0 1 2 4 6" | |
PING_IP6=2a01:4f8:171:27a2:0:77:77:254 | |
STATISTIC_LOG_FILE=/tmp/gw_connection_statistic.log | |
for ENABLED in $GATEWAYLIST; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
node_mac_paths=('.nodes[].nodeinfo.network.mac') | |
batctl_count_hops() { | |
batctl -m "$1" tg | | |
sed 's/([[:space:]]*[0-9]\+)//g' | # Remove tq field | |
sed 's/[[:space:]]\+/ /g' | # Replace duplicate whitespace characters by a single space | |
cut -d' ' -f5 | # Extract nexthop | |
egrep -o '([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}' | # Match mac addresses only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Retrieved from https://web.archive.org/web/20160516165158/http://lexandera.com/2009/01/adding-alert-support-to-a-webview/ | |
*/ | |
final WebView browser = (WebView)findViewById(R.id.browser); | |
/* JavaScript must be enabled if you want it to work, obviously */ | |
browser.getSettings().setJavaScriptEnabled(true); | |
final Context myApp = this; | |
NewerOlder