Forgot MariaDB Password – Fix: sudo mariadb -u root

Forgot your MariaDB password? Luckily, you don’t need password for administrative access.

$ sudo mariadb -u root

Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

PHP Database SELECT and INSERT Example – php-pdo

LAMP is probably the most popular web stack in the world. It powers Wikipedia, and it powered Facebook for years.

To access your MariaDB database from PHP server side scripts, use PHP-PDO. Remember to use library functions to put user data into SQL strings (prepare, bind); and sanitize away any Javascript before showing data to users (htmlentities).

Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Install MariaDB on Ubuntu 18.04 – Database Management System, the New MySQL

MySQL/MariaDB is probably the most popular multi-user database in the world.

Since Ubuntu 18.04, you should install mariadb-* packages to use this database.

Continue reading

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

CPU Usage Percent – Python One-Liner for Load Average per CPU

Processor usage is 88%. But how do I get a number like this?

For gurus, this Python one-liner prints CPU usage

$ python3 -c "print('{:.0f}%'.format( float('$(cat /proc/loadavg)'.split()[0]) / float('$(nproc)')*100 ) )"
12%

The rest of us can read on how this works. Also, we can learn how to read system state from plain text files and understand load averages.

Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , | Leave a comment

sshfs – Securely Mount Filesystems over the Internet – Survive Suspend and Network Down

Sshfs allows you to browse your own folders over the Internet.

It’s a real mount, a directory on your computer, so any program can access the files. And it uses SSH, making it very secure.

$ sshfs -o reconnect,ServerAliveInterval=5,ServerAliveCountMax=3 tero@example.com:/ mnt/tero/

Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Aikataulu DigiStartUp dig4tn024-3002 – syksyllä 2018 – molemmat 1p ja 2p – 10 op

English: Create your own digital product and find paying customers. Real customers, actual money. Course is in Finnish.

Luo digitaalinen tuote ja hanki sille maksavia asiakkaita. Siis oikeita asiakkaita, joilta saa oikeaa rahaa.

Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , | 4 Comments

Aikataulu – Monialaprojekti Infra pro4tn004-3001 – syksy 2018 – 10 op

English: Complete a project with a company as a client. Work with students from different tracks and backgrounds. Course in Finnish.

Starting projects: Collect and visualize logs with ERK. File server for film company. Identity Management. Video surveilance and system provisioning. Finnish Text to Speech. Fishing. All Free software.

Previous course feedback was very good, 4.1 out of 5. And students even published two books!

Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 11 Comments

Vulnerable Super Secure Password Recover – SQL Injection Example

Can you exploit OWASP #1 vulnerability? I wrote a simple vulnerable password recovery app for practicing SQL injections.

(Vulnerable) Super Secure Password Recover ™ is written with Python 3, Flask and Postgres. You can do bad code even with the best tools.

Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

Install Metasploitable 3 – Vulnerable Target Computer

Metasploitable 3 is a ready made practice target for penetration testing. Vagrant installation takes just minutes.

Continue reading

Posted in Uncategorized | Tagged , , , , , | 1 Comment

Aikataulu – Linux palvelimet ict4tn021-3003 – to 8-14 – alkusyksy 2018p1 – 5 op

English: Learn to manage your own Linux server – in 8 weeks. Beginners welcome. Student feedback excellent 4.8 out of 5. Course is in Finnish.

Aloita nollasta. Opiskele 8 viikkoa ja hallitset omaa Linux-palvelinta.

Opintojakson suoritettuaan opiskelija:

  • Osaa hallita Linuxia palvelimena
  • Osaa tehdä tärkeimmät asetukset tärkeimmille palvelimille (Apache, OpenSSH)
  • Osaa asentaa www-ohjelmointiin sopivan alustan
  • Osaa tehdä itselleen uusia asetuksia palvelinohjelmistoihin ohjeiden avulla
  • Tietää esimerkkejä palvelintilan tarjoajista ja hinnoista sekä fyysisten palvelinten vastaavista ominaisuuksista
Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , | 3 Comments

ESP32 – Arduino Compatible 6 EUR DevBoard with WiFi and Sensors

ESP32 and a pen. Photo by Heikki Hietala.

My colleague Heikki Hietala experimented with ESP32. He could connect it to Eduroam, the world wide free WiFi network for students.

Heikki used it for building a network controlled version of his morse moai, but you could use ESP32 to build robots and Internet of Things.

ESP32 is Arduino compatible microcontroller, making it very easy to program. It could work nicely with IoT Rapid Prototyping Laboratory Setup I co-developed with Kimmo Karvinen.

Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , | Leave a comment

Two Books by My Students – Odoo ERP in Finland, Wi-Fi Penetration Testing


My students published two books: Wi-fi Penetration Testing for Beginners and Avoimen lähdekoodin ERP – Odoo Suomessa.

Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , | Leave a comment

Configuration Management Course is Finished

Jussi controls 2071 slaves with Salt.

My students have created many interesting projects on configuration management course.

The feedback was excellent, 4.6 out of 5. The most common feedback (mode) was 5 out of 5. Thank you!

Jussi Isosompppi controlled 2071 slave computers with Salt.

Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Cracking WPA2 Wireless Networks with WPS

My students Kermorvant, Jääskeläinen, Kurenmaa and Eulenberger broke WPA2 protected wireless LAN using WPS attack.

They’ve also broken WEP and brute forced bad WPA and WPA2 passwords. And they show how to buy and configure network cards for this.

Moral of the story: don’t use WEP, use WPA2. Don’t use WPS. And also encrypt end to end with SSH, PGP or other strong encryption. For more security content, read project intrusion blog and come to Penetration Testing course.

Obviously, it’s illegal to break into other peoples networks. Using the tools mentioned requires separated lab environment and other precautions.

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , , | Leave a comment

Clickable Table of Contents for Markdown – Ctags with Gedit

MarkDown is a very fast way to write text. You just mark headings with hash “#”. Empty line creates paragraph.

This tutorial shows how you can create a clickable table of contents of your MarkDown document – right inside your text editor. This makes it easier to edit long documents.

Continue reading

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

Versionable, Plain Text Reference Management – Git, PanDoc and BibTex

When you’re writing peer-reviewed articles, you must have references. Good news: you can have everything in plain text files, even the citation and reference management.

I have only used this exact BibTex setup for a while. However, having written five books in plain text (e.g. MarkDown) and with version control software, I could not imagine using old-fashioned word processor.

Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , | Leave a comment

Control Windows with Salt

This long article explores Windows management with Salt.

First, it shows you how to automatically install software to Windows, control Windows boxes behind NAT and firewall and remotely run arbitrary PowerShell commands on Windows.

$ sudo salt '*' pkg.install gedit,firefox,steam,vlc

$ sudo salt winslave cmd.run 'Get-ChildItem C:' shell='powershell'

Later, more complicated features are looked at.

Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Money Moving with Odoo, the Open Source ERP

I bought some candy from Odoo ERP based web shop.

Update: they now have PayPal integration, too.

My students Emre Olgun, Roni Selander and Konsta Vaarala are running Odoo, the open source ERP. Enterprise Resource Planning (ERP) is a single system to control everything on the business side of a company, from sales to HR.

If you know Finnish, read more on OpenSourceERP2018.wordpress.com blog. They have both technical and business related articles.

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment

Simple Secrets in Salt Pillars

This is a simple example for storing secrets in Salt Pillars. If you have a hundred slaves machines, you don’t need to trust them all.

Following this tutorial requires working salt master-slave installation and salt states.

Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment

Configure a Live USB in Two (2) Commands – terokarvinen/sirotin

You boot a computer form your USB stick and give two commands. It’s configured.

Install your programs, your settings, your configuration – automatically. Start from Sirotin, fork it, make it your own.

wget https://raw.githubusercontent.com/terokarvinen/sirotin/master/run.sh
bash run.sh
 

Fork me on GitHub: terokarvinen/sirotin.

Posted in Uncategorized | Tagged , , , , , , , , , | Leave a comment

Secrets in Salt Pillars – SSH Port Change

Salt helps you configure 1, 10, 100 or more computers. Secrets, such as encryption keys, must be given to authorized slaves only. In Salt, secrets are kept in pillars.

If you are just starting with pillars, do pillars tutorial first. This short listing of configuration files and commands is meant for people who already know salt. If you’re just getting started, see salt master-slave installation and salt states.



Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Aikataulu – Linux palvelimet ict4tn021-3003 – alkusyksy 2018 – 5 op

Moved: current course page is Aikataulu – Linux palvelimet ict4tn021-3003 – to 8-14 – alkusyksy 2018p1 – 5 op

Tero’s Linux Course is ict4tn021-3003. I will only give one beginner course on Linux in the Autumn, because penetration testing, configuration management and other advanced courses take most of my time.

Learn to manage your own Linux server – in 8 weeks. Beginners welcome. Student feedback excellent 4.8 out of 5. Course is in Finnish.

Moved: current course page is Aikataulu – Linux palvelimet ict4tn021-3003 – to 8-14 – alkusyksy 2018p1 – 5 op

Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment

ViolentMonkey for User Scripts – Your Own JavaScript or CSS on Any Website

ViolentMonkey Firefox Addon allows you to run your own JavaScript and use your own styles on any website. It’s Free software (MIT license) and source code is available.

My fix for Moodle sorrow borders works with ViolentMonkey. It seems that my old GreaseMonkey scripts don’t work on GreaseMonkey, but they do work on ViolentMonkey.

Continue reading

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

NoReload Heroes on Nintendo Switch – New Distribution Agreement for StupidStupidGames

My former students got a Nintendo Switch distribution agreement (press release in Polish). Congratulations Suvi, Jussi, Eelis and the whole StupidStupidGames!

I can still remember when you published your first beta on my innovation course in 2013 and your first Steam release in 2016.

Read the story of NoReload Heroes.

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Plenary Speaker and Program Chair in ICIM2018, Oxford

My invited speech in ICIM 2017, Chengdu, China.

If you are coming to ICIM2018 conference in Oxford, come to say hi. They kindly invited me as a plenary speaker and program chair.

4th International Conference on Information Management (ICIM2018) will be in Oxford, UK, from May 25th to 28th.

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment
  • Recent Posts

  • Picks

  • Boxing Clock for AndroidOcton8 Diving T-ShirtsShaking Tower Panda Android GameLearn Chinese with Android
  • Student projects