Useful everyday scripts, in no particular order. Among others: A HTTP(2)(S)/FTP/DAV server, a find(1) like utility, a Python library to bind to privileged ports, a generic unpacker script and a transparent proxy redirector using namespaces.
Python JavaScript Shell C++ C HTML Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
autodep
bell
check_integrity
colors
conky_and_bg
dotfiles
emoji
errno
fstore
gdo
httpd
iwebd
libprivbind
livereload
lock
mosh-firewall
nonroot_apt
on
online_tools
owncloudfs
passwrd
paxel
presenter_remote
pskill
pydoce
runGraphical
sshproxy
todo
tunsocks
unpack
venv
zshrc
µredshift
.gitmodules
README
setup_gui_fontsandcolors.sh
setup_new_home.zsh

README

This is a collection of scripts I use in my everyday life. They are very useful
to me, but I don't consider them interesting enough to maintain them in
individual repositories. 

I mainly put this up here so that I can easily move into new computers' $HOMEs.
Don't expect too much documentation. But feel free to contact me if you have
any questions. In particular, please contact me if you want to package one of
these programs - I'll move them into individual repositories in that case.

Unless stated otherwise in specific files, everything within this repository is
released under the terms of the GNU Public License 3.0 <http://www.gnu.org/licenses/gpl-3.0.html>.


To get startet:

wget https://raw.githubusercontent.com/phillipberndt/scripts/master/setup_new_home.zsh
zsh setup_new_home.zsh



Contents:

* autodep

  A work in progress tool to automate the annoying process of manually
  installing dependencies while building packages from source. The idea
  is to scan the output of the build command for known error messages,
  use apt-file to find the related package, install it, and iterate
  until the build succeeds.

* bell

  A tiny X11 tool running a command every time a bell is rang. I use this
  to flash my notebook's LCD brightness.

* check_integrity

  Basic, non-hack-proof system integrity checker informing root about
  updated/new files.

* colors

  Small tool to output the different console codes for the various colors.
  I tend to forget them all the time.

* conky_and_bg

  My conky configuration, worker scripts and a hilarious™ script which
  automatically changes your desktop image by a random choice from a
  backgrounds directory - with support for dual screen setups and automatic
  ImageMagick invocation to draw a semi-transparent box at the right edge of
  the screen. Where conky resides. For X11 setups without RGBA extension, where
  conky can not do this by itself.

* emoji

  A simple pygtk script that displays a list of all currently defined Unicode
  emoji and lets the user select one, which is then copied into the clipboard.

* errno

  Print information on a specific errno, or search for a E* constant.

* fstore

  A very simplistic file and note storage server with a command line
  client and a web interface for editing and drag & drop upload.

* gdo

  find(1)-like utility with support for

      find -regextype pcre -iregex "$1" -exec "$2" \;

  but (a) this really works with pcre, (b) more comfortable:

      gdo regex +anotherregex <command>

  use $.. or %.. to backreference in the command.

* httpd

  I'm sometimes in need of an ad-hoc httpd, but not a toy one like my ihttpd,
  but one which can actually handle real-world-situations. This wrapper script
  runs lighttpd, in the same fashion as my ihttpd: Serving from ./, with
  support for PHP.

* iwebd

  Monolithic instantaneous httpd and ftpd with support for everything you'd ever
  need to quickly move a from b to c. Including webdav, http/2, cgi, rewriting of
  URLs, on-the-fly compression, and much more. Has no dependencies outside the
  Python standard library.

* libprivbind

  A small library like privbind/authbind to bind to privileged ports based
  on an access control list in /etc, with a Python module to access the
  functionality. With this, pyprivbind.gensocket(80) will return a
  socket.socket() bound to the HTTP-port.

* livereload

  An implementation of a livereload server backend. I know that tons of
  ruby/node.js tools serve the same purpose, however, I wanted something
  that is small and works out of the box on my PCs. (Which usually have
  Python installed, but neither ruby nor node.)

* lock

  A very simple X11 locking app. Screen blanking & PAM authentication only.

* mosh-firewall

  suid wrapper for mosh-server that opens the port used for the connection in
  the firewall for the duration of the session.

* nonroot_apt

  1) A script for Debian based systems which allows non-root users to install
     missing packages into their own $PREFIXes. It basically invokes apt-get to
     get the URLs to the package and its dependencies and then downloads all
     the files and unpacks them whereever the user wants them. Includes basic
     tracking for already satisfied dependencies.
  2) A script to copy already installed packages and all their dependencies
     into a given directory. Useful to set up chroots.
  3) A script to use apt repositories from non-Debian distributions

* on

  Wait for some kind and event and then execute a command. Event types
  include inotify events (file changes), network throughput measurements,
  or that a certain process exits.

* owncloudfs

  Mount public owncloud shares in userspace

* passwrd

  Meant to be bound to a hotkey. Searches for the active window's title,
  decrypts a secret password file, searches for the correct password and enters
  it automatically.

  You'll need to use gpg-agent for this to work. No support for
  passphrase-input-windows

* paxel

  My attempt on rewriting axel in Python using cURL. The idea was that cURL
  probably provides more robust downloads, and that a scripted variant could
  eventually be extended to support stuff like dynamic addition/removal of
  downloader threads. Currently, the only benefit this has over axel is that it
  maintains a state file which allows to resume interrupted downloads.

* presenter_remote

  A small HTTP server that serves a page that you can use to control your
  presentations using your smartphone.

* pskill

  A interactive pkill variant. Sends SIGKILL automatically if SIGTERM fails,
  previews which processes it will kill, regex and fuzzy matching on full
  cmdline.

* pydoce

  A tool to open python source code in an editor, not by specifying the file
  name, but instead the pythonic path to a definition (i.e. os.path.isdir).

* sshproxy

  Convenience tool to setup a chain of ProxyCommand options to enter a
  multi-hop SSH connection.

* runGraphical

  Yet another program starter for X11. Define shortcuts and execute the
  commands easily. For example, put

      o opera

  in the configuration file and start the program. Now you'll only need to hit
  "o", and opera will start.

* todo

  Tiny todo file management with support for annotations like due date,
  priorities and multiple hosts.

* tunsocks

  Tunsocks is a program that runs other programs such that all their network
  traffic is transparently proxied through a SOCKS5 proxy. In comparison with
  tsocks, it runs without LD_PRELOAD, but by creating a TUN device, and in
  comparison with e.g. redocks, it does not use iptables, but network namespace
  isolation instead. This allows to easily force single processes to use a
  proxy, in a quite bullet proof fashion: Unless tunsocks itself is
  exploitable, there is no way to access the outside world through the network
  other than the socks tunnel. Note that this does not isolate the process
  from other processes or the file system, both of which might allow other
  ways to circumvent this!

* unpack

  Generic unpacker for a variety of formats. Takes care of not messing up your
  $PWD. Can download files for you.

* venv
  
  A tool to setup virtual environments for more than just python. Also contains
  a library which hooks into getpwent and replaces the home-directory with
  $HOME - this is required in GTK apps since GTK ignores $HOME and uses passwd
  entries instead.

* zshrc

  My .zshrc (actually, ~/.zsh directory)

* µredshift

  Tiny redshift alternative with only the most basic features.