Press "Enter" to skip to content

Tag: linux

Techy: Changing Python Shebang path from absolute to env

I’m just working in some Python code, and quite a lot of it has the “shebang” line for the Python interpreter set as an absolute path (such as /usr/bin/python) which won’t work for me as I need the scripts to use whichever version of Python I have configured in my “environment”: and the ideal way to do this is to call is using /usr/bin/env python – so how do I change these…

Snippet/Techy: Fixing Debian Signatures were invalid – Key Expired

If you are running Debian/Ubuntu and you are getting “The following signatures are invalid” when running apt-get commands (such as apt-get upgrade) and the error looks like: Reading package lists… Done W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com jessie InRelease: The following signatures were invalid: KEYEXPIRED 1487236823 KEYEXPIRED 1487236823 KEYEXPIRED 1487236823 W: GPG error: http://nginx.org jessie InRelease: The following signatures were invalid: KEYEXPIRED 1471427554 W: Failed to fetch http://repo.mysql.com/apt/debian/dists/jessie/InRelease W: Some index files failed to download. They have been ignored, or old ones used instead. As root run: for K in $(apt-key list | grep expired | cut -d’/’ -f2 | cut -d’ ‘ -f1); do sudo apt-key adv –recv-keys –keyserver keys.gnupg.net $K; done Source: http://serverfault.com/a/615362/12514

[Techy] localdomain settings in Linux Mint using DNSMasq

If you are developing websites on Linux Mint, then you might want to set a DNS Wildcard so that anything on localdomain (*.localdomain) resolves to your machine (i.e. test.localdomain , anything.localdomain). So how can you do this? First of all, you need to install dnsmasq “a lightweight, easy to configure DNS forwarder and DHCP server”, this can be simply done using: sudo apt-get install dnsmasq Now you just need to configure it. Create a file in /etc/dnsmasq.d/ using something like nano, pico, vi, emacs : sudo nano -w /etc/dnsmasq.d/localdomain.conf with the following settings: address=/localdomain/127.0.0.1 listen-address=127.0.0.1 This will tell DNSMasq to setup a wildcard for everything on “localdomain” to point to 127.0.0.1 and to listen for DNS requests on 127.0.0.1. Now just restart DNSmasq: sudo service dnsmasq restart and you are nearly done. You now just need to change your DNS servers in network manager. On the Linux Mint task bar, right click on the network icon and select “Edit connections” and edit the connection you are using. Select “IPv4 Settings”. If you have “Automatic (DHCP)” selected, change it to “Automatic (DHCP Addresses only)”. Then add the DNS server 127.0.0.1 and others of your choosing (such as the Google 8.8.8.8 and…

Funny: Funny Linux Commands

Shamelessly stolen from Frank Mash (or, as UK news organisations will probably argue, “this orphaned content found was at …”): % cat “food in cans” cat: can’t open food in cans % nice man woman No manual entry for woman. % “How would you rate Quayle’s incompetence? Unmatched “. % Unmatched “. Unmatched “. % [Where is Jimmy Hoffa? Missing ]. % ^How did the sex change operation go?^ Modifier failed. % If I had a ( for every $ the Congress spent, what would I have? Too many (‘s. % make love Make: Don’t know how to make love. Stop. % sleep with me bad character % got a light? No match. % man: why did you get a divorce? man:: Too many arguments. % !:say, what is saccharine? Bad substitute. % %blow %blow: No such job. % \(- (-: Command not found. $ PATH=pretending! /usr/ucb/which sense no sense in pretending! $ drink matter matter: cannot create $ ddate Today is Prickle-Prickle, the 69th day of Chaos in the YOLD 3176 and of course: unzip ; strip ; touch ; grep ; finger ; mount ; fsck ; more ; yes ; umount ; sleep Some of these work,…