Browsed by
Category: Shell

Shell stuff

Command Line Interface To Own Python Functions

Command Line Interface To Own Python Functions

Now go to the Commands-Section and add your own.

Starting MySQL Client Without Credentials

Starting MySQL Client Without Credentials

You can start mysql without -u, -o and database name if you create a file ~/.my.cnf with the following content:

Repack a Debian Package

Repack a Debian Package

This is a little script to repack a debian package.

Usage:
./repack.sh the-package.deb

It will unpack the *.deb, give you a midnight commander to edit it and when you leave it, the package will be rebuild and saved into ./build/ . The ./build/ and ./extract/ directories will be recreated each time you run the script, be warned!

Python3(.4) Https Server

Python3(.4) Https Server

Here is an example how to create a https server in python3.4. It assumes you have got a ssl certificate in ssl/localhost.pem and a html template under templates/index.html.

Furthermore it assumes you have created a virtual environment under ./env/ and installed jinja2 into it.

The server code:

Shell script to create the certificate (self signed)… this is a variation of an elder post. Here it creates a certificate only (self) signed for localhost:

And if you like you can import the file ssl/localhost.crt as trusted server certificate into your browser. This will overcome the certificate warning.

 

Shell Script To Create Self Signed SSL-Certificates In Various Formats

Shell Script To Create Self Signed SSL-Certificates In Various Formats

Shell Menues

Shell Menues

Here is a python class to create such shell menues:

shell-menues

Use it like that:

The output and thus the returned values will be something like:

Github page

Find Files Changed Within The Last X Days, Recursive

Find Files Changed Within The Last X Days, Recursive

You can find files that have been changed within the last X days like this:

Just replace the X with the number of days.

To pack these files right here do a:

This is especially useful if you’ve reset the timestamps before beginning to change something like this: