Fallout 3 Computer Hack

February 1, 2016 Leave a comment

In Fallout 3 there is a minigame where you need to hack computers. I made a simple script to do these hacks easily. Here is a running example:

$ ./crack.py example.txt
Words and scores:
-----------------
traveling  5
swiveling  5
wandering  4
spreading  4
desperate  3
telephone  3
sterilize  3
deformity  3
september  2
belonging  2

Tip: it's a good idea to start with the word that has the highest score.

Guessed word: traveling
Number of matches: 1
The password is one of these words:  ['desperate', 'september', 'deformity']

Guessed word: desperate
Number of matches: 3
The password is:  deformity

The script can be found on GitHub.

Categories: python Tags: , ,

getting started with Kivy

January 24, 2016 Leave a comment

Intro
Kivy is an open source library for developing multi-touch applications. It is cross-platform (Linux/OSX/Windows/Android/iOS) and released under the terms of the MIT License.

It comes with native support for many multi-touch input devices, a growing library of multi-touch aware widgets and hardware accelerated OpenGL drawing. Kivy is designed to let you focus on building custom and highly interactive applications as quickly and easily as possible.” (source)

Problem
How to install it in a virtual environment? I could install it but when I wanted to create a basic app, it dropped some error messages (“pygame or sdl missing”).

Solution
Instead of Pygame I chose the SDL way. So under Manjaro I had to install globally the following packages:

sudo pacman -S gstreamer sdl2_ttf sdl2_mixer sdl2_image

Maybe gstreamer is not necessary, I’m not sure.

I suggest working with Kivy in a Python 2 virtual environment. Why? If you want to build your app for Android, then you can use the buildozer tool. However, at the moment it doesn’t support Python 3 :( I’m sure it’ll change but at the moment stick with Python 2.

Then, in your virtual environment, install these:

pip install cython
pip install kivy

Let’s try if it works. Activate your virt. env. and launch the Python interpreter in it. Then try this code:

>>> from kivy.app import App
>>> App().run()

If you get a blank window with black background, then everything is fine.

Links

find out a github user’s (hidden) email address

January 11, 2016 Leave a comment

Problem
You want to contact someone on GitHub but (s)he doesn’t indicate his/her email on the profile page. What to do?

Solution
Figure it out :) The manual steps are indicated here. I made a Python script of it that can be found here: https://github.com/jabbalaci/Bash-Utils/blob/master/github_user_email.py .

Usage example:

$ ./github_user_email.py 
Github info (username or repo. link): https://github.com/jabbalaci/Bash-Utils                                 
jabba.laci@gmail.com

If you want to hide your email address, then here are some tips.

Categories: python Tags: ,

differences between Python 2 and Python 3 with examples

January 7, 2016 Leave a comment
Categories: python Tags: ,

Pew: A tool to manage multiple virtual environments written in pure Python

January 4, 2016 Leave a comment

Problem
You are fed up with virtualenv and virtualenvwrapper.

Solution
Use Pew, which is a new kid on the block. I collected my notes about it here, where I also provide two convenience scripts. I don’t want to copy all that here, so check out the GitHub link.

2015 in review

December 31, 2015 Leave a comment

The WordPress.com stats helper monkeys prepared a 2015 annual report for this blog.

Here's an excerpt:

The Louvre Museum has 8.5 million visitors per year. This blog was viewed about 200,000 times in 2015. If it were an exhibit at the Louvre Museum, it would take about 9 days for that many people to see it.

Click here to see the complete report.

Categories: python Tags: ,

[nodejs] increase memory limit

December 22, 2015 Leave a comment

Problem
Your Node.js program terminates with a “process out of memory” error. How to increase the memory limit?

Solution
Launch your program with the following switch:

node --max-old-space-size=8192 mem_eater.js

This way you give 8 GB RAM to your process.

More tips here.

Categories: nodejs Tags: ,
Follow

Get every new post delivered to your Inbox.

Join 107 other followers