Raspberry PI kivy touchscreen clock

vrfuyr

I got a lot of Raspberry PI from display calendars, with touchscreen. Since they are not going to be used anymore (in principle) I want to recycle them somehow. The idea is to have a small screen that will give you some information, like on the image above.

I’m loosely following the guide I found here. I first do the update and upgrade of the system (apt-get update, apt-get upgrade, reboot). Then with more or less glory I go through the kivy installation. My problem was here:

Go into the [input] section, remove the lines that are in there and put in:

mouse = mouse
mtdev_%(name)s = probesysfs,provider=mtdev
hid_%(name)s = probesysfs,provider=hidinput

Without it, you end up with a dead display. Now we install the python-beautifulsoup, since python-requests appear to be already installed. I download the zip file from the repository, and simply try it out. I end up with the wordclock on English. To change the language, we simply go to the folder screens/wordclock and edit conf.json, replacing “english” for the language of your choice. However, there seems to be some glitches and the rest of the promised features (like the weather forecast) don’t work with my just updated Raspbian Jessie. I try to get the API key and so on, but I’m not lucky and the project is already quite old. So next time, let’s try another approach 🙂

Advertisements
Posted in bits, hardware, kivy, python, raspberry, software | Leave a comment

OSX change all computer names

There are several exploits appearing recently on the macs. For example the root hole on OSX High Sierra. To change once for all your new laptop name “MyName-macbookpro”, we need to type 3 simple commands in a row:

scutil --set ComputerName "mylovelylaptop"
scutil --set HostName "mylovelylaptop"
scutil --set LocalHostName "mylovelylaptop"

Now, after a reboot, your default name “MyName-macbookpro” will be called “mylovelylaptop” everywhere, to the deepest part of your system. For real and for all. You can type these commands as root, or typing sudo before, if you didn’t enable root user. That I recommend to do if you didn’t yet.

Posted in bits, hardware, mac, osx, software | Leave a comment

The foebook

– So I was invited to this thing…the foebook…do you have it?
– I can’t tell you, sorry.
– But you can speak about it, right?
– Yes, I could. You can indeed speak about it.
– I think I can tell you about the invitation. It comes in paper. A letter, without any stamp, without return address. Obviously delivered by hand in my mailbox. That’s why I thought it was you who did it.

“It’s been a while since the last time I got mail. Yes, everybody is still getting spam, this or that newspaper that is basically a printout of ads from local traditional shops. So I almost dropped it together with the spam when I saw the yellow envelope. The sensation was weird. A letter. Nowadays. Still, my name was handwritten on it (can you write, by the way?) so I came back into my house, in my pyjama, to carefully open in the kitchen that object coming from the past. Inside the envelope there was a printout with a web address and a login name. Knowing like I know the ad business I obviously didn’t suspect anything but a fancy campaign so without hesitation I called a browser and logged in.”

“The fist impression is like any other social network. You get a newsfeed, and so on. But most of it is blurred out, and on the notification bar you have a score and a message menu. My message menu, in red, was containing a welcome letter and a button. After clicking on it, a new message came. And there was the challenge.”

“Challenges are not suggestions, neither menaces. But it is clear you need to complete them if you want to check what the others are doing: otherwise you only see the blurred area. My first challenge was simple: I was asked to go to a supermarket and slip something in the pocket of one of the clients. After that, I was supposed to accuse him of shoplifting.”

“After I was done with it, I must say, I wanted more. Then I got the rules: whatever I do will be given a mark, the mark will be translated onto points, and the points will allow me to see what the other foes are doing. There will be people commenting my actions, and giving me new ideas. A little bit like being a youtuber. So far so good.”

“The problem is what to do. I started easy. After the opening task, I decided to glue some locks. Then I crashed a party, last Friday, do you remember? I was not really drunken, I was acting, believe me. I got a lot of good remarks on that one. Then I broke the windows of a service car. Unfortunately, all what I got after all was like a hundred points. I started to feel shame on me. That’s why I’m telling you. Was I not good enough to do something interesting? Am I already done on foebook?”

– Probably, man. Don’t worry about it. I’m sure it’s good to be there, and without disclosing any information about my status, I can tell you that foebook  is fundamentally malign. Don’t you see it? They only want to create mayhem, so that they can sell something afterwards. The question is what do they want to sell?

– I think I know what they want to sell. Security. What else?
– You’re right. Security is the most precious item you can buy nowadays. How much do you pay for your coverage?
– You mean house and personal and so on? I will not tell you man!
– A lot of money. A lot of money more than before the internet was born. Those were good days, don’t you think so?
– What do you know about it? The internet is there since decades before you were born! Or are you cheating me with your age?
– No cheating man. You can feel like there’s no internet when you go to the wild. Didn’t you go to the wild?
– The wild? I’m not interested!
– You should try it. It’s liberating.
– I also feel liberated when I go to the toilet. And I don’t need to fight bears or boars to feel that. I pass.

Posted in dragons, fragments, friends, new dreams, shorts | Leave a comment

Small talk

When the car arrived I found out it was already occupied. Schmidt was all distributed over the back sit. He gave me his crooked smile and waved his hand to end up pointing to the opposite couch, like if the car was his property.

– Helllooo man! Long time no see you! Since last year, right? – Today was 2nd of January and my first working day. I ignored him and took the sit he pointed before. I didn’t have the mood to invent an excuse to wait for a new car. Besides, I was already charged for the run. – Take a coffee. – A coffee appeared on my side of the table, the smoke floating in my direction. I’m a tea person, but again, I don’t like to discuss early in the morning. I took it and tried unsuccessfully to find a position so I could ignore Schmidt for the rest of the trip. – So tell me my friend – my friend my ass – what are your new year resolutions?

– I plan to migrate. – I said without thinking.

– Migrate? Where to? Ain’t you happy here?

– Yes I am. – It’s important to look happy, otherwise they may accuse me of not having the right working attitude, that I don’t have, by the way. – The truth is, I’m looking for a bigger challenge. And what bigger challenge you have than to migrate to Mars?

– To Mars? – He laughed his nervous smile just to afterwards comb his hair the way he does when nervous. – How did you managed to pass the tests? – I didn’t manage, but I don’t care about it. – Oh maaannn I’m going to miss you so much! When do you move?

– Next month, most probably. Although it depends on the project, of course. – The car speeds up, and I’m forced to mannouvre so that the coffee stays with me and doesn’t go over me. – I want to finish what I am doing here before. It is important no to leave open issues, don’t you think so? – My car mate tries to look outside.

– You know what? I’m going to try also. I’m tired of the food prices, I’m tired of the floods…- say it, please, say it!- I could even say I’m tired of my job! – Yes! Now I can use this moment to manipulate him, if I want. – I can tell you because you live soon, this job that we do here, on this beautiful land of God, has no future. – The car chooses this moment to stop. The doors open at the same time. We’re there. I wait a little until I see the back of Schmidt to return my glass of coffee to the car and leave. When I stand, looking around, he suddenly turns back to shout me:

– Did you hear me? No future!

Posted in aliens, friends, new dreams, shorts, time travel, unpublished | Leave a comment

Where do we go now

I was wondering: my goal when I started writing here was simply to empty my mind, to clean up my logs, to write down what I passed through during my work so I don’t need to do it again. Of course the ignorance about a subject can be sorted out with Google and patience, but that is a very annoying solution if you’re in hurry. With this, I have a quick reference to what I did, and when. Now, thanks to the increasing number of visitors I feel an urge to pontificate, like an illegal priest, about this or that topic that is touching my soul, so that I end up with a post or two per day. But I will not do that. It is tempting to become one of them, but I will survive. You may think I’m trying to teach you, but I’m not. I’m just writing down it on a way that is not deadly boring to read if you need to.

Also, some of the post are indeed scheduled ones, so if one day I have a lot to write about it, I do it, but I publish on another. This is specially the case of my fiction pieces, new dreams, aliens, and similar ones. Just click on the tags 🙂 . My dreams must be written as soon as they arrive, and polished later. I need to clean them up, so you will never guess who’s the person inspiring the role, and me, myself, will forget that also.

Posted in dragons, fantasy | Leave a comment

Python test we can connect to MySQL db

Probably you have mysql for some reason. You may have some form of it because of Leginon or you simply have phpMyAdmin because you need it for something else. If you don’t have it, probably you will anytime soon, since database features are quite demanded. What I’m sure you have is phyton.  Now, we’re are going to find out how to connect to an external MySQL database using that tool.

Let’s say our database is in a computer called admin.mydomain.org. We are on another client client.mydomain.org of the same network, meaning we can ping admin by name. I will assume you know the name of the database “admindb” and you have the username and password for it. To connect to it is pretty simple. Call the python prompt from your client (by executing it on Windows, by simply typing python on linux) and do this:

import MySQLdb
db = MySQLdb.connect(host="admin.mydomain.org", user="adminuser", 
passwd="passwd", db="admindb")

Where your user is adminuser and password passwd. Be aware of the syntax, password is given after the command passwd, for example, not password 😉

If you get no errors, after typing what’s above, you’re ready to go. The database admindb can be now modified by python commands, or most probably, by python scripts. Why you want to do that remotely from client and not on the admin machine? I can think of dozens of reasons, but let’s say admin is a dedicated machine, that is not in the neighbourhood and it’s only offering you the database services. It could even be a docker…maybe I will write about what to do with a database at one point. Would you like that? 🙂

Posted in bits, containers, docker, linux, mysql | Leave a comment

Enable ping response on Windows 7

pee0hNew devices come with windows computers. Or they don’t come with computers but we need to attach a windows PC. In any case, it is usually nice to have it online, so we can transfer data from them, etc. And it is nice to know if it’s still online. A basic way to do that is to enable a firewall rule. It is scary but at the same time, very simple. I quote from the above post:

Control Panel –> System and security –> Windows Firewall –> Advanced settings –> Inbound rules –> New rule –> custom rule

In Protocol and ports: Protocol: ICMPv4
On the same panel go to customize, choose “Specific ICMP types“, check the box “echo request“, go to next… next… and save it.

It is effective as soon as you close the window. Now we will be able to ping the Windows 7 PC…what’s next? Maybe to configure a VNC connection? Stay tuned, as usual!

Posted in bits, windows | Leave a comment