Skip to content

Instantly share code, notes, and snippets.

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

flatlinebb

🏠
Working from home
View GitHub Profile
@flatlinebb
flatlinebb / extract-audio.bat
Last active March 31, 2024 05:33
How to extract audio from video with ffmpeg, into separate files
REM This script will check all MP4 files in the current folder
REM and process them to extract audio into separate files (M4A).
REM The audio files use the same file name as the original video file, with a number, and the M4A extension
REM This is a batch file, to be run on Windows, in Command Line.
REM For Linux, see the "extract-audio.sh" gist below
REM In this example, there are 2 audio tracks, which get split out to 2 separate audio files.
REM The original video file remains unchanged.
REM If you want have a video file with more than 2 audio tracks,
REM just add more "-map 0:a:0 -c copy "%~na audio track 1.m4a"" sections:
REM -map 0:a:0 -c copy "%~na audio track 1.m4a"
@flatlinebb
flatlinebb / pulseway-service-check.sh
Last active January 15, 2019 21:21
Checks the Pulseway service and restarts it if not running. Logs to /var/log/pulseway.log
#!/bin/bash
### Pulseway Service Check ###
### Log file location: /var/log/pulseway.log
### Add to crontab for hourly checks at half-past the hour, with no console output:
### 30 * * * * /root/pulseway-service-check.sh > /dev/null 2>&1
### This way, crontab doesn't try to email the result of the job
# Create $variable with the current service status
STATUS=`systemctl show -p SubState --value pulseway`
# For older versions of systemd, skip the "--value"
@flatlinebb
flatlinebb / debian-initial-install.sh
Last active December 23, 2019 02:18
Debian Server Init Script
#!/bin/bash
logfile=/root/$$.log
exec > $logfile 2>&1
# Can be executed remotely with this command:
# curl -L https://gist.githubusercontent.com/flatlinebb/3dea9f4ee2c39ca92ec8bcbd6b0b9a82/raw/f3b63c55d007375bfb4cb10832ff05d6315ce6d8/debian-initial-install.sh | bash
# Get OS details:
lsb_release -a
@flatlinebb
flatlinebb / screen_cheatsheet.markdown
Last active December 30, 2018 23:38 — forked from jctosta/screen_cheatsheet.markdown
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r <session_name>
@Lukas238
Lukas238 / wsl_kali_RDP.md
Created March 7, 2018 02:03
Windows 10 WSL Kali remote desktop protocol

Remote Desktop for Kali Linux under Windows 10 WSL

  1. Install Kali linus from the Win10 store.
  2. Start Kali linux: $ kali
  3. Install [wget]: apt-get install wget
  4. Donwload the Kali installation script for [xfce4]: $ wget https://kali.shxfce4.sh
  5. Run the script: $ sudo sh xfce4.sh

This will take some time.

  1. Start the remote desktop server: $ sudo /etc/init.d/xrdp start

By default it will start on port 3390.

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}
@mrik23
mrik23 / MSOL-BulkRemoveDirectAssignedLicense.ps1
Last active June 7, 2023 04:23
Remove in bulk direct assigned license to users who have group assigned license with Azure AD PowerShell v1
<#
Modified version of the script from Microsoft Documentation.
Removed the part that checks if the users is assigned more products than the group assigned license.
Added connection part and help to find Sku and Group Object ID.
This script requires Azure AD (aks MSOL) PowerShell v1. It doesn't seem possible to do so with v2.
Ref: https://docs.microsoft.com/en-us/azure/active-directory/active-directory-licensing-ps-examples
#>
Import-Module MSOnline
$UserCredential = Get-Credential
@barbietunnie
barbietunnie / udemy-courses-download-using-cookies.md
Last active April 7, 2024 22:24
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}
@flatlinebb
flatlinebb / mpv_links.txt
Last active December 6, 2021 22:59
YouTube Playlist Links for MPV Player
@thebentern
thebentern / list-usb-devices.ps1
Last active August 26, 2022 23:01
List connected USB devices with powershell
gwmi Win32_USBControllerDevice |%{[wmi]($_.Dependent)} | Sort Manufacturer,Description,DeviceID | Ft -GroupBy Manufacturer Description,Service,DeviceID