Skip to content

Instantly share code, notes, and snippets.

@meatcar
meatcar / README.md
Last active March 12, 2024 01:38
A better "Reboot to {OS}" script for rEFInd Next Boot selection for Windows
@NotoriousPyro
NotoriousPyro / OutlookAutostartAndMinimise.ps1
Last active March 19, 2023 11:13
Automatically finds, runs and places Outlook into the system tray.
<#
.Synopsis
Automatically finds, runs and places Outlook into the system tray.
.Description
Automatically finds, runs and places Outlook into the system tray.
By default, Outlook will start full-screen even when you have the option to minimize tray enabled and start the app as minimized.
@dentechy
dentechy / WSL-ssh-server.md
Last active March 30, 2024 16:16
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@Darkhogg
Darkhogg / !RebootToOs.md
Last active March 18, 2024 10:04
"Reboot to {OS}" scripts for rEFInd Next Boot selection

Reboot to {OS}

This a collection of notes and files used in my quest to create "Reboot to Windows" and "Reboot to Linux" scripts (and desktop shortcuts) for Linux and Windows respectively that automatically reboot my system and instruct rEFInd to auto-select the appropriate OS entry.

General Information

The key for achieving this is to modify the EFI Variable PreviousBoot with GUID 36d08fa7-cf0b-42f5-8f14-68df73ed3740, which rEFInd uses to store the last entry selected in the menu and, if using the + default entry, will be used to select the default OS. By doing this, we trick rEFInd into booting the OS we choose without having to be physically there to press the keyboard.

@Onurtag
Onurtag / ExploreEverything.ahk
Last active February 25, 2024 07:23
ExploreEverything.ahk: An autohotkey (ahk v1) script that allows you to search the current explorer folder, your desktop and more using Everything
#SingleInstance Force
#NoTrayIcon ;Comment this line by adding a ; in front of # if you want the tray icon to be visible. Like ;#NoTrayIcon
EverythingPath := "C:\Program Files\Everything\Everything.exe" ;Set this to your everything.exe path. Keep the quotes.
;---Optional setup for special folders---
MyRecycleBin := "Recycle Bin" ;If your OS is not English, go to your explorer's "Recycle Bin" (🚮) folder and change this to the title of that window. Keep the quotes.
MyThisPC := "This PC" ;If your OS is not English, go to your explorer's "This PC" (💻) folder and change this to the title of that window. Keep the quotes.
MyHome := "Home" ;(Windows 11) If your OS is not English, go to your explorer's "Home" (🏠) folder and change this to the title of that window. Keep the quotes.
@HaleTom
HaleTom / print256colours.sh
Last active April 14, 2024 13:35
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
# This xorg configuration file will start a dummy X11 server.
# move it to /etc/X11/xorg.conf
# don't forget apt install xserver-xorg-video-dummy;
# based on https://xpra.org/Xdummy.html
Section "ServerFlags"
Option "DontVTSwitch" "true"
Option "AllowMouseOpenFail" "true"
Option "PciForceNone" "true"
Option "AutoEnableDevices" "false"
@ql-owo-lp
ql-owo-lp / ddns-start
Last active March 12, 2023 00:04
Asus-Merlin-DuckDNS
#!/bin/sh
# register a subdomain at https://www.duckdns.org/ to get your token
# put 'hostname:token' in the 'Host Name' field under DDNS
# e.g. myhost:abcdefgh-1234-5678-9876-f71b0ed7a7fe
DDNS_HOSTNAME_FIELD=$(nvram get ddns_hostname_x)
SUBDOMAIN=$(echo "$DDNS_HOSTNAME_FIELD" | awk -F':' '{print $1}')
TOKEN=$(echo "$DDNS_HOSTNAME_FIELD" | awk -F':' '{print $2}')
IPV4=$(nvram get wan0_ipaddr)
@outadoc
outadoc / pushover
Last active August 17, 2023 16:10
Pushover Bash Script
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: ./pushover <message> [title]"
exit
fi
MESSAGE=$1
TITLE=$2