Skip to content

Instantly share code, notes, and snippets.

@bartoszek
bartoszek / aur-add-github-remote.sh
Last active April 11, 2019 06:48
Move AUR packages to github.com and post message to package comment section informing users about the switch.
#!/bin/bash -x
# configuration: github user(required), github token(optional)
token="" #https://developer.github.com/v3/guides/getting-started/#oauth
user=""
#test if user non-zero
[ -z "$user" ] && {
echo "fill user variable in configuration section" >&2;
@random-robbie
random-robbie / cams.m3u
Created November 23, 2017 15:43
Open Cameras
#M3U
#EXTINF:-0, CCTV - 93.185.113.36 - Italy
rtsp://93.185.113.36/live/ch00_0
#EXTINF:-0, CCTV - 213.37.135.235 - Spain
rtsp://213.37.135.235/live/ch00_0
#EXTINF:-0, CCTV - 88.26.221.17 - Spain
rtsp://88.26.221.17/live/ch00_0
#EXTINF:-0, CCTV - 195.46.114.161 - Russian Federation
rtsp://195.46.114.161/live/ch00_0
#EXTINF:-0, CCTV - 195.211.232.90 - Russian Federation
@dianjuar
dianjuar / a stop job is running for session c2 of user.md
Last active May 15, 2022 12:39
Fixing "a stop job is running for session c2 of user xxx (xs / 1min 30s)"

Fix a stop job is running for session c2 of user xxx (xs / 1min 30s)

enter image description here

This advice is pointing to arch based distributions. Manjaro in special

Install watchdog

# pacman -S watchdog >

@marcellodesales
marcellodesales / formatted.sh
Last active November 14, 2023 19:22
One-liner REST server using netcat - nc
rm -f out
mkfifo out
trap "rm -f out" EXIT
while true
do
cat out | nc -w1 -l 1500 > >( # parse the netcat output, to build the answer redirected to the pipe "out".
export REQUEST=
while read line
do
line=$(echo "$line" | tr -d '[\r\n]')
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active June 21, 2024 07:34
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@cehoffman
cehoffman / colorize.c
Created August 7, 2011 00:04
ZSH STDERR Colorizing
/* $Id: colorize.c 3816 2004-07-03 17:01:32Z lefevre $
*
* Colorize the standard input. Written for zsh stderr coloring.
* This was taken from a mail archive on the subject of colorizing
* the stderr stream in zsh. It was written by Vincent Lefèvre as far
* as I know. It is here so it can be used in a brew formula.
*
* The intended usage is to place a line like the following in your zshrc
* exec 2>>(colorize `tput bold; tput setaf 1` `tput sgr0` > /dev/tty &)
*
@jtriley
jtriley / terminalsize.py
Created July 26, 2011 21:58
Get current terminal size on Linux, Mac, and Windows
#!/usr/bin/env python
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()