Category: software

Django ALLOWED_HOSTS
01/08/2019
After you installed Django and wanted to view it from another local machine you got this error:
DisallowedHost at / Invalid HTTP_HOST header: ‘192.168.3.20’. You may need to add u’192.168.3.20′ to ALLOWED_HOSTS.
I use this to work around it.
Run as:
1 |
python3 manage.py runserver 0:8000 |
Open the settings:
1 |
nano settings.py |
Change and add:
1 2 |
ALLOWED_HOSTS = ['localhost','127.0.0.1'] ALLOWED_HOSTS += ['192.168.3.{}'.format(i) for i in range(256)] |
Now everything and anyone on your local network should have acces to the website.
^that’s also a big warning!
Share the post "Django ALLOWED_HOSTS"

Retrieve data from a .csv and show it a window
23/07/2019
I needed a quick way to show temps from a .csv on a screen.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# # Retrieve the data from the .CSV and show it in a nice window # import matplotlib.pyplot as plt import numpy as np # draw the figure so the animations will work fig = plt.gcf() fig.show() fig.canvas.draw() while True: data = np.genfromtxt('test_data.csv', delimiter=',', dtype=None, skip_header=0, names=('date', 'value')) plt.plot(data['date'], data['value'], color="red") plt.title("Temperatuur") plt.xlabel("tijd") plt.ylabel("Temp") plt.xticks(rotation=90) # Rotate the date text plt.pause(60) # wait 60 seconds before update fig.canvas.draw() |
Share the post "Retrieve data from a .csv and show it a window"

Raspberry Pi and Spotify
20/07/2019
I wanted to use the Pi to play spotify playlists but spotify does not allow that (DRM rights and browser issues).
What does work is streaming from another device to the Pi:
See: Spotify Connect client for the Raspberry Pi
https://github.com/dtcooper/raspotify
Just follow the steps and you should see this on spotify:
Share the post "Raspberry Pi and Spotify"

Freenode Nickserv & ChanServ commands
19/07/2019
Always handy….
– For more information on a command, type:
– /msg NickServ help
– For a verbose listing of all commands, type:
– /msg NickServ help commands
– ***** NickServ Help *****
– The following commands are available:
– ACC Displays parsable session information.
– ACCESS Changes and shows your nickname access list.
– CERT Changes and shows your nickname CertFP authentication list.
– DROP Drops an account registration.
– GHOST Reclaims use of a nickname.
– GROUP Adds a nickname to your account.
– HELP Displays contextual help information.
– IDENTIFY Identifies to services for a nickname.
– INFO Displays information on registrations.
– LISTCHANS Lists channels that you have access to.
– LISTLOGINS Lists details of clients authenticated as you.
– LISTOWNMAIL Lists accounts registered to your e-mail address.
– LOGOUT Logs your services session out.
– REGAIN Regain usage of a nickname.
– REGISTER Registers a nickname.
– RELEASE Releases a services enforcer.
– SENDPASS Email registration passwords.
– SET Sets various control flags.
– SETPASS Changes a password using an authcode.
– STATUS Displays session information.
– TAXONOMY Displays a user’s metadata.
– UNGROUP Removes a nickname from your account.
– VACATION Sets an account as being on vacation.
– VERIFY Verifies an account registration.
– ***** End of Help *****
– For more information on a command, type:
– /msg ChanServ help
– For a verbose listing of all commands, type:
– /msg ChanServ help commands
– ***** ChanServ Help *****
– The following commands are available:
– ACCESS Manipulates channel access lists.
– AKICK Manipulates a channel’s AKICK list.
– CLEAR Channel removal toolkit.
– COUNT Shows number of entries in access lists.
– DEOP Removes channel ops from a user.
– DEVOICE Removes channel voice from a user.
– DROP Drops a channel registration.
– FLAGS Manipulates specific permissions on a channel.
– GETKEY Returns the key (+k) of a channel.
– HELP Displays contextual help information.
– INFO Displays information on registrations.
– INVITE Invites you to a channel.
– OP Gives channel ops to a user.
– QUIET Sets a quiet on a channel.
– RECOVER Regain control of your channel.
– REGISTER Registers a channel.
– SET Sets various control flags.
– STATUS Displays your status in services.
– SYNC Forces channel statuses to flags.
– TAXONOMY Displays a channel’s metadata.
– TEMPLATE Manipulates predefined sets of flags.
– TOPIC Sets a topic on a channel.
– TOPICAPPEND Appends a topic on a channel.
– TOPICPREPEND Prepends a topic on a channel.
– TOPICSWAP Swap part of the topic on a channel.
– UNBAN Unbans you on a channel.
– UNQUIET Removes a quiet on a channel.
– VOICE Gives channel voice to a user.
– WHY Explains channel access logic.
– ***** End of Help *****
Share the post "Freenode Nickserv & ChanServ commands"

Xtrlock : Minimal lock program
18/07/2019
Sometimes you want to lock your screen but still want to view what your machine is doing.
xtrlock is simple and just does that.
1 |
sudo apt-get install xtrlock |
Type in a terminal ‘xtrlock’ and a little icon replaces your mouse cursor. To unlock just type your password.
You can also add a shortcut in a menu or whatever you like.
If you still like to blank your monitor use: xtrlock -b
Share the post "Xtrlock : Minimal lock program"