Skip to content

Instantly share code, notes, and snippets.

@prochor666
prochor666 / MC Cheat Sheet
Created February 2, 2024 16:40 — forked from samiraguiar/MC Cheat Sheet
Midnight Commander Cheat Sheet / Shortcuts
Note for newcomers:
In the shortcuts below, "C" stands for CTRL and "A" stands for "ALT". This is a convention
used in the Midnight Commander documentation and was kept here.
You can also use "ESC" instead of "ALT", which is useful on Macbooks.
Main View
---------------------------------------------------------------
- File/directory operations
// ==UserScript==
// @name youtube popup killer
// @namespace http://tampermonkey.net/
// @version 0.3
// @description try to take over the world!
// @author Selbereth
// @match https://*.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
@prochor666
prochor666 / net-stat.sh
Last active August 17, 2021 22:12
Very basic netwrork statistics
#!/bin/bash
# @author prochor666@gmail.com
#
# Check stats for alive network devices
# RED 1, GREEN 2 and RESET color
DEVICEDOWN=$(tput setaf 1)
DEVICEUP=$(tput setaf 2)
RESET=$(tput sgr0)
@prochor666
prochor666 / port-usage.sh
Last active August 14, 2021 09:18
Check port usage
#!/bin/bash
# @author prochor666@gmail.com
#
# Check port usage
function inUse()
{
if [[ -z $(ss -tulwn | grep -E "LISTEN.*:${@} ") ]];
then
@prochor666
prochor666 / search-logrotate.sh
Last active August 10, 2021 14:05
Found specific logrotate directive in /etc/logrotate.d/nginx
#!/bin/bash
# @author prochor666@gmail.com
# Grep /etc/logrotate.d/nginx file for given string
function isPresent()
{
if [[ -z "$(grep -i "${@}" /etc/logrotate.d/nginx)" ]];
then
echo "ERROR: ${@} not found"
@prochor666
prochor666 / php-module-test.sh
Last active August 10, 2021 14:06
Test if php module is installed
#~/bin/bash
# @author prochor666@gmail.com
# Test if php module is installed
function moduleIsInstalled()
{
if [[ -z "$(php -m | grep ${@})" ]];
then
echo "ERROR: ${@} module is not installed"
else
@prochor666
prochor666 / ssh_client.py
Created July 9, 2021 20:44 — forked from ghawkgu/ssh_client.py
Python ssh client sample
#!/usr/bin/env python
import paramiko
hostname = 'localhost'
port = 22
username = 'foo'
password = 'xxxYYYxxx'
if __name__ == "__main__":
@prochor666
prochor666 / rsync delete command.md
Created September 25, 2020 09:26 — forked from AtumRa/rsync delete command.md
rsync deleting files without copy

Rsync delete orphan files from target only - no copy

Calling Rsync in the following way, using --existing, --ignore-existing and --delete enables the following:

  • Only files at target that do not exist at source will be deleted.
  • Skipping all file copy operations from source to target.
$ rsync -ri \
  --delete --existing --ignore-existing --progress \
  /path/to/source/ /path/to/target
@prochor666
prochor666 / conv.sh
Created March 9, 2020 18:47
Bash VOD/HLS media convertor
#!/bin/bash
# Sanatorium media convertor
# prochor, 2020
# prochor666@gmail.com
clear
# Create new website
echo -e "\e[38;5;14m|------------------------------------------- \e[0m"
echo -e "\e[38;5;14m| Sanatorium VOD/HLS media convertor \e[0m"
@prochor666
prochor666 / host-create.sh
Created March 6, 2020 10:11
Create web host, MySQL db, user, ftp and jail user in Debian Buster
#!/bin/bash
# Sanatorium web host creator for Debian 10 Buster
# prochor, 2020
# prochor666@gmail.com
clear
# Create new website
echo -e "\e[38;5;14m|------------------------------------------- \e[0m"
echo -e "\e[38;5;14m| Sanatorium web host creator for Debian 10 Buster \e[0m"