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
// needs sqlite.h from sim's lib that is not in simlib | |
#include "lib/simlib/sqlite3/sqlite3.h" | |
#include "lib/simlib/sqlite3/zipfile.h" | |
#include <simlib/filesystem.h> | |
#include <simlib/sqlite.h> | |
class Zip { | |
SQLite::Connection conn_; |
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
// Krzysztof Małysa | |
#include <assert.h> | |
#include <errno.h> | |
#include <math.h> | |
#include <signal.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/time.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> |
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
# When on battery stop some applications from eating the power | |
# Install with: sudo install -Dm 0644 50-foo.rules /lib/udev/rules.d/ | |
# SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", RUN+="/usr/sbin/killall -STOP Discord alarm-clock-applet ksysguard clementine" | |
# SUBSYSTEM=="power_supply", ATTR{status}!="Discharging", RUN+="/usr/sbin/killall -CONT Discord alarm-clock-applet ksysguard clementine" | |
SUBSYSTEM=="power_supply", ACTION=="change", ATTR{online}=="0", RUN+="/usr/sbin/pkill -STOP --exact ksysguard" | |
SUBSYSTEM=="power_supply", ACTION=="change", ATTR{online}=="1", RUN+="/usr/sbin/pkill -CONT --exact ksysguard" | |
# Run kayboard normalizer | |
# SUBSYSTEM=="input", SUBSYSTEMS=="usb", ACTION=="add", RUN+="/home/quasar/Documents/scripts/keyboard-normalizer.sh" |
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 | |
# Place in file: /etc/NetworkManager/dispatcher.d/pre-up.d/wlan_auto_block.sh | |
# Make the file safe for execution: sudo chmod 744 /etc/NetworkManager/dispatcher.d/pre-up.d/wlan_auto_block.sh | |
if [ "$1" = "enp3s0" ]; then | |
rfkill block wifi # rfkill is used for unblocking, so we have to use it for blocking | |
fi |
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=Eliminate cracking headphone sound | |
# Enable with: sudo systemctl enable --now crack_sound_fix.service | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/sbin/hda-verb /dev/snd/hwC0D0 0x1d SET_PIN_WIDGET_CONTROL 0x0 | |
StandardOutput=syslog | |
StandardError=syslog |
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
// Krzysztof Małysa | |
#include <array> | |
#include <cassert> | |
#include <condition_variable> | |
#include <cstring> | |
#include <fcntl.h> | |
#include <mutex> | |
#include <netdb.h> | |
#include <netinet/in.h> | |
#include <poll.h> |
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
#include <arpa/inet.h> | |
#include <csignal> | |
#include <poll.h> | |
#include <simlib/config_file.h> | |
#include <simlib/debug.h> | |
#include <simlib/filesystem.h> | |
#include <simlib/process.h> | |
#include <sys/resource.h> | |
// Krzysztof Małysa |
NewerOlder