Skip to content

Instantly share code, notes, and snippets.

View criztovyl's full-sized avatar

Christoph Schulz criztovyl

View GitHub Profile
@criztovyl
criztovyl / servermultiscript.sh
Last active August 29, 2015 14:16
Use server simplified.
#!/bin/bash
############
#===Simple Server Skript===
# Author Christoph Schulz <cs@chsc.de>
# Version of 06 Apr 2013
#
#==INFORMATION==
# This skript uses SFTP only!
#==Configuration==
# - server: The server, e.g. ssh.example.com
@criztovyl
criztovyl / watch.sh
Last active August 29, 2015 14:19
Watch!
#!/bin/bash
# ToDo: Usage.
###
# Programs
###
ZENITY="/usr/bin/zenity"
YOUTUBEDL="/usr/local/bin/youtube-dl"
XCLIP="/usr/bin/xclip"
###
# Error Codes
@criztovyl
criztovyl / .shellPepper
Last active August 29, 2015 14:20
Shell Pepper
#!/bin/bash
####
# This is some shell pepper.
# Copyright (C) 2015 Christoph "criztovyl" Schulz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@criztovyl
criztovyl / dirsync-micro.sh
Last active August 29, 2015 14:20
Keeps directories up-to-date
#!/bin/bash
# This is a program for simpler rsync syncing.
# Copyright (C) 2015 Christoph "criztovyl" Schulz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@criztovyl
criztovyl / call_yt_api.sh
Last active August 29, 2015 14:21
Calling YouTube API from commandline (requires jsonCLI.py)
#!/bin/bash
# Call YouTube API from command line.
# Copyright (C) 2015 Christoph "criztovyl" Schulz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@criztovyl
criztovyl / yesdo.sh
Last active August 29, 2015 14:21
Ask a Yes/No question and executes an action dependent on the answer
#!/bin/bash
# Asks a user a Yes/No question and executes actions dependent on the answer.
# Copyright (C) 2015 Christoph "criztovyl" Schulz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@criztovyl
criztovyl / to_assoc.php
Last active August 29, 2015 14:24
Associates integer-indexed arrays
<?php
/*
Replace array indices with associative keys
Copyright (C) 2015 Christoph "criztovyl" Schulz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@criztovyl
criztovyl / ssj.sh
Last active August 29, 2015 14:25
Splits, sorts and joins a string by a separator
#!/bin/bash
# A Bash/Ruby script that splits, sorts and joins a string
# Copyright (C) 2015 Christoph "criztovyl" Schulz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@criztovyl
criztovyl / pimus.sh
Last active August 29, 2015 14:27
Opens remote cmus screen in current shell. Starts cmus if it's not running.
#!/bin/bash
pimus()
{
# Try to show cmus screen, start new cmus instance into cmus screen if not available
if ! screen -qr cmus; then
# Start new cmus into cmus screen
screen -mdS cmus cmus
# Wait for cmus socket (up to 5x5 seconds)
@criztovyl
criztovyl / monthdiff.sh
Created January 26, 2016 22:05
Calculates differences between months, also across years.
#!/bin/bash
# Script for calculating month differences
# Copyright (C) 2016 Christoph "criztovyl" Schulz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,