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 / 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>
@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
@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}
@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
@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
@tommybutler
tommybutler / smartcheck.sh
Last active December 29, 2023 11:52
Script to quickly scan the S.M.A.R.T. health status of all your hard drive devices in Linux (at least all the ones from /dev/sda to /dev/sdzz). You need smartctl installed on your system for this script to work, and your hard drives need to have S.M.A.R.T. capabilities (they probably do).
#!/bin/bash
# install the smartctl package first! (apt-get install smartctl)
if sudo true
then
true
else
echo 'Root privileges required'
@jmsaavedra
jmsaavedra / ffmpeg_install.md
Last active February 29, 2024 09:36
Install FFmpeg on a Linux Box

Install FFmpeg via CLI on Linux box

These steps walk through installing a static binary of any ffmpeg version on to your linux machine. If you want to compile from source, there are several ways to do so. Here's the official guide. Tested and works on an AWS EC2 Ubuntu instance, but should work on any Linux machine.

  • SSH into your instance and become root