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/perl | |
# This script fetches the performance data for various Tangerine Bank investment funds and exports them to: | |
# - CSVs called <fund_name>.csv with all historical data in format: "YYYY-MM-DD","12.34" | |
# - (optional) A single JSON file with trend data: {"Fund Name":{"0":12.34,"1":"12.56"...},"Fund Name":...} | |
# - (optional) PNG line chart | |
# All data is publicly available from: https://www.tangerine.ca/en/products/investing/performance | |
# This is just a handy way to use the data locally for various purposes. | |
# | |
# Should be run daily Tuesday-Saturday, such as with cron: |
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/perl | |
use strict; | |
use warnings; | |
my $addr = `ip addr`; | |
my %links; | |
my $current; | |
foreach (split '\n', $addr) { |
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/perl | |
# TODO: at the moment, words are only broken up by 0 and 1. Should search for smaller sequential words. For example: | |
# 6908378 finds: mytest | |
# but 1698378 does not | |
use strict; | |
use warnings; | |
# Default Debian ispell dictionary |
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/perl -w | |
# Files containing current and max brightness values | |
my $cur_file = "/sys/class/backlight/intel_backlight/brightness"; | |
my $max_file = "/sys/class/backlight/intel_backlight/max_brightness"; | |
# About (See help() for more): | |
# Script to read and write to the backlight brightness file. Allows for easy control of the backlight without a proper backlight daemon (eg. when logged in to a console). | |
# Requires ownership/permissions for the brightness file. This can be automatically acquired with the following SystemD Unit: |
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/perl | |
use strict; | |
use warnings; | |
use constant MONTH => sub{{ | |
'January' => 1, | |
'February' => 2, | |
'March' => 3, | |
'April' => 4, |
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/perl | |
use strict; | |
use warnings; | |
use POSIX ":sys_wait_h"; | |
STDOUT->flush(); | |
use File::Which qw( which ); | |
foreach ( qw| convert scanimage | ) { |
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/perl | |
use strict; | |
use warnings; | |
# Dependencies | |
use LWP::UserAgent; # Usually pre-installed, available on CPAN | |
use XML::Hash::XS; # CPAN or libxml-hash-xs-perl on Debian | |
# Feeds that should be used if no arguments are provided |
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/perl | |
######################################################################## | |
# Dependencies | |
######################################################################## | |
# | |
# Depends on JSON::XS and Proc::ProcessTable | |
# | |
# Debian: | |
# apt install libjson-xs-perl libproc-processtable-perl |
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=Minecraft | |
After=network.target | |
[Service] | |
Type=simple | |
User=minecraft | |
Group=minecraft | |
WorkingDirectory=/var/lib/minecraft/current | |
ExecStart=java -jar -Xmx2G -Xms1G server.jar --nogui |
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/perl | |
# Accompanying SystemD Unit file compatible with these locations/user: https://gist.github.com/JohnMertz/c6bb4a9298dd3dc53b8030ff50466226 | |
# | |
# Expects the following minecraft directories: | |
# ./ The PWD is taken dynamically. In the SystemD unit, it is /var/lib/minecraft | |
# current The latest version. This will be the executable directory. | |
# 1.16.2 Directories will be created for every old version | |
# update_minecraft.pl This script | |
# |
NewerOlder