Skip to content

Instantly share code, notes, and snippets.

View MetalDevOps's full-sized avatar
🏠
Working from home

Erik Ferreira MetalDevOps

🏠
Working from home
View GitHub Profile
@hongkongkiwi
hongkongkiwi / rclone-mount-synology
Created February 7, 2022 11:40
RClone mount script for Synology NAS
#!/bin/bash
ACTION="$1"
# RClone Service Series
RCLONE="/bin/rclone"
CONFIG_FILE="/volume1/@rclone/config/rclone.conf"
MOUNT_NAME="${2:-"union_series"}"
MOUNT_POINT="${3:-"/volume1/media/series"}"
MOUNT_CACHE_DIR="/volume1/@tmp/@${MOUNT_NAME}"
@u8sand
u8sand / two-way-rclone.py
Last active April 2, 2023 21:50
A CLI for two-way rclone syncing with safe conflict resolution
#!/usr/bin/env python3
__ETAG__ = '' # NOTE: replaced by update script
__version__ = '2.0.9'
__GIST__ = 'https://gist.githubusercontent.com/u8sand/498766e540939ca2c3550c1986deb5bd/raw/two-way-rclone.py'
__README__ = '''
This utility facilitates "smart" two-way-sync between two rclone stores.
The first location is considered the "localpath" & metadata about the previous
execution is stored in this location. This information can be used to determine
if changes were made on the local side or on the remote side since the last run.
using System;
using LogDataCollector;
namespace th_salvageupdater
{
class Program
{
static void Main(string[] args)
{
//Console.WriteLine("Hello World!");
@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
Last active September 17, 2024 10:45
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

Note

If you want to use pure WSLg, you can try the new WSLg (XWayland) tutorial or the WSLg (Wayland) tutorial.

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key component we need to install is the desktop metapackage you want (GNOME, KDE, Xfce, Budgie, etc) and tigervnc-standalone-server.

For this setup, I will use Ubuntu (20.04, 22.04 and 24.04 are working), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the [Sample

@djfdyuruiry
djfdyuruiry / ubuntu-20.04-wsl2.ps1
Created May 29, 2020 00:20
Ubuntu 20.04 in WSL 2
## change to your username
$user="wsl-user"
# download latest 20.04 release
curl --location `
--remote-name `
"https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-wsl.rootfs.tar.gz"
# import into WSL 2
wsl --import `
@djfdyuruiry
djfdyuruiry / README.md
Last active September 19, 2024 05:44
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@Hikari9
Hikari9 / input.conf
Last active May 4, 2024 21:45
MPV Config File for Ceylon (anime)
AXIS_UP ignore
AXIS_DOWN ignore
AXIS_LEFT ignore
AXIS_RIGHT ignore
MOUSE_BTN3 add volume 5
MOUSE_BTN4 add volume -5
MOUSE_BTN5 seek -5
MOUSE_BTN6 seek 5
@barbietunnie
barbietunnie / udemy-courses-download-using-cookies.md
Last active September 13, 2024 18:00
Downloading Udemy videos with youtube-dl

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@xbb
xbb / README
Last active September 14, 2024 00:07
IDRAC6 Virtual Console Launcher
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface.
You can use the user and password that you use for the web interface.
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS.
You don't need to install it, just extract it or copy the files in "jre" folder.
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor.
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture.
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs.
@Clijsters
Clijsters / elevateMe.bat
Last active January 6, 2023 12:59
Sudo for Windows - Self elevating .bat-File
@echo off
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' (
goto mainScript
) else (
goto getPrivileges
)