Skip to content

Instantly share code, notes, and snippets.

View danielrosehill's full-sized avatar

Daniel Rosehill danielrosehill

View GitHub Profile
@danielrosehill
danielrosehill / Demo_Netflix_Resumer_Xdotool.sh
Last active April 22, 2020 12:26
Script to automatically resume Shtisel on Netflix
#!/bin/bash
# A bash script for launching 'Shtisel' in Netflix
# By: Daniel Rosehill / DanielRosehill.co.il
#
# Call arandr script to pipe output to HDMI (TV)
/bin/bash /home/daniel/TV_only.sh
# Unmuting volume and then setting it to 100%
amixer sset Master unmute
amixset sset Master 100%
# Open 'Shtisel' series page in Netflix
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file, it will be overwritten on install.
Copy the file to $HOME/.config/openbox/ instead. -->
<openbox_config xmlns="http://openbox.org/3.4/rc">
<resistance>
<strength>10</strength>
<screen_edge_strength>20</screen_edge_strength>
</resistance>
<focus>
@danielrosehill
danielrosehill / redshift.conf
Created May 25, 2020 08:55
My Redshift configuration
[redshift]
temp-day=4500
temp-night=3000
gamma=0.8
adjustment-method=randr
location-provider=manual
[manual]
lat=31.79
lon=35.21
@danielrosehill
danielrosehill / Redshift_my_man_doc.md
Last active June 3, 2020 18:15
Redshift man page for people without patience

An unintelligent solution for finding the optimum level of blue light filtering for your viewing comfort.

Firstly get the daemon going:

redshift &

If you don't like what you see reset the adjustment:

redshift -x

@danielrosehill
danielrosehill / rsync commands.txt
Created June 19, 2020 00:15
Rsync commands from pulling from hosting (remote source SSH) to local
Standard
rsync -e ssh user@host:/files/ /home/user/backup
With custom port
rsync -a -e "ssh -p 14022" user@host:/backup/dir /local/dir
Rsync doesn't do remote <-> remote. For this, take a look at rclone
# Main site backup
# Files
rsync -arvvvz --progress -e 'ssh -p 45454' [email protected]:/home/cpaneluser/public_html/ /volume1/HostingBackups/mysite/
# MySQL
rsync -arvvvz --stats --progress --remove-source-files -e 'ssh -p 45454' [email protected]:/home/user/backup /volume1/HostingBackups/mysite/
sudo rsync -avz MyBackup/ [email protected]::SharedFolder/MyBackup
Syntax notes:
Two colons after local IP and before shared folder name
@danielrosehill
danielrosehill / post-byline.php
Created July 6, 2020 16:37
Backup Wordpress archive custom post-byline.php
<div class="post-byline">
<span class="post-date">
<?php
$date = get_the_date();
printf( esc_html_x( 'Published %s', 'Published DATE', 'chosen' ), $date );
?>
</span><br/>
IN <?php the_field('pubtitle'); ?>
<br/>
<a href="<?php the_field('publishurl'); ?>" target="_blank">ORIGINAL LINK &nbsp;&nbsp;|&nbsp;&nbsp; <a href="<?php the_field('backupcopy'); ?>"target="_blank">LOCAL BACKUP</a> </a>
mysqldump --add-drop-table -u db_username -p db_name > mybackup.sql

Get Tailscale Running On Proxmox LXC Containers

To add only a little to what's already documented:

SSH into your Proxmox host and jump to the config store for your LXCs:

cd /etc/pve/lxc

Now you'll get a list of all the .conf files. The number = the LXC ID.