Skip to content

Instantly share code, notes, and snippets.

View fredeerock's full-sized avatar

Derick Ostrenko fredeerock

View GitHub Profile
@fredeerock
fredeerock / Mounting a Box.com Drive on Windows.md
Last active March 14, 2025 15:11
Mounting a Box.com drive on Windows that also automatically runs at logon.

Mounting a Box.com Drive on Windows

  1. Install rclone by opening Terminal and typing winget install Rclone.Rclone
  2. Install WinFSP: winget install WinFsp.WinFsp
  3. In Terminal, run rclone config create myBox box
  4. A browser window should pop up. Login to box.com there.
  5. To mount the Box drive, type into terminal: rclone mount myBox: B: --vfs-cache-mode full --vfs-cache-max-size 100G --vfs-cache-max-age 24h --vfs-read-chunk-size 128M --vfs-read-chunk-size-limit 1G --buffer-size 256M
  6. Create VB Script: @('Set objShell = CreateObject("WScript.Shell")', 'objShell.Run """C:\Users\dostr\AppData\Local\Microsoft\WinGet\Links\rclone.exe"" mount myBox: B: --vfs-cache-mode full --vfs-cache-max-size 100G --vfs-cache-max-age 24h --vfs-read-chunk-size 128M --vfs-read-chunk-size-limit 1G --buffer-size 256M --log-file C:\rclone\logs\rclone.log --log-level DEBUG", 0, False') | Out-File -Encoding ASCII C:\rclone\rclone-mount.vbs
  7. Create a task to automatically run rclone at Windows startup: `Regi
@fredeerock
fredeerock / main.py
Created November 25, 2024 16:18
A PyQT6 example of a WinUI looking accent button
import sys
from PyQt6.QtWidgets import QApplication, QPushButton, QMainWindow
from PyQt6.QtCore import QEvent
class WinUIButton(QPushButton):
def __init__(self, text, parent=None):
super().__init__(text, parent)
self.setMouseTracking(True)
self.installEventFilter(self)
self.setStyleSheet("""
@fredeerock
fredeerock / sha256pass.sh
Created May 28, 2019 03:33
Create SHA256 Password
$(python -c 'import crypt,getpass;pw=getpass.getpass(); print(crypt.crypt(pw,crypt.mksalt(crypt.METHOD_SHA256))) if (pw==getpass.getpass("Confirm: ")) else exit()')
@fredeerock
fredeerock / renameConn.sh
Created May 16, 2019 18:44
Rename a networkmanager connection without knowing the original connection name.
#!/bin/bash
nmcli -g UUID c show | while read line; do if [ `nmcli -g connection.interface-name c s $line` = $LAN_IFACE ]; then nmcli c mod $line con-name lan-con; fi; done
@fredeerock
fredeerock / unusedNets.sh
Last active May 16, 2019 18:41
Remove non-activated network connections from NetworkManager.
#!/bin/bash
nmcli -f UUID,STATE con show | tail -n +2 | grep -v activated | awk '{print $1}' | while read line; do nmcli con delete uuid $line; done
@fredeerock
fredeerock / preferipv4.sh
Created April 10, 2019 20:08
makes ipv4 preferred over ipv6
#!/bin/bash
echo "precedence ::ffff:0:0/96 100" >> /etc/gai.conf
@fredeerock
fredeerock / removeIpTables.sh
Last active March 19, 2019 20:16
remove all iptables rules
# List rules.
sudo iptables -L
# Set default policies to accept.
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT
# Flush and delete tables and chains.
sudo iptables -t nat -F
@fredeerock
fredeerock / MACspoof.md
Last active March 6, 2019 16:18
Spoof MAC address MacOS
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport --disassociate
sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/./0/2; s/.$//')
networksetup -detectnewhardware
@fredeerock
fredeerock / wpBackupRestore.sh
Created December 6, 2018 16:42
WordPress Backup and Restore
# Backup WordPress DB. Find the servername, username, and db name from wp-config.php.
mysqldump --column-statistics=0 -h <sql-server-name> -u <sql-username> -p <sql-db-name> | bzip2 -c > blog.bak.sql.bz2
# Restore WordPress DB.
# First, uncompress the sql backup file.
bzip2 -d blog.bak.sql.bz2
# Second, import the the database tables. Added protocol for docker compatability.
mysql -h localhost -P 8037 --protocol=tcp -u root -p wordpress < blog.bak.sql
@fredeerock
fredeerock / wpBackupRestore.sh
Created December 6, 2018 16:41
Simple WordPress Backup and Restore
# Backup WordPress DB. Find the servername, username, and db name from wp-config.php.
mysqldump --column-statistics=0 -h <sql-server-name> -u <sql-username> -p <sql-db-name> | bzip2 -c > blog.bak.sql.bz2
# Restore WordPress DB.
# First, uncompress the sql backup file.
bzip2 -d blog.bak.sql.bz2
# Second, import the the database tables. Added protocol for docker compatability.
mysql -h localhost -P 8037 --protocol=tcp -u root -p wordpress < blog.bak.sql