Raspbery Pi – Getting HDMI to Work Properly

I used a HDMI cable with a DVI adapter without issue, but I started having issues when I ditched the adapter. The resolution went down, and the smaller image was centered, leaving a big black border.

So how did I fix it? Uncomment or add the following line to /boot/config.txt

hdmi_drive=2

Value 2 means normal HDMI (sound will be sent over HDMI if enabled). Value 1 would be DVI mode. No idea why the adapter made it work perfectly without the settings change. Autoconfig?

I think it’s amazing that the Raspberry Pi can handle 1080p.

i3wm – i3status unable to detect battery fix

If you install i3wm and i3status fail to detect your battery, here’s one solution:

Open /etc/i3status.conf and look for “battery 0 {“. Add the following line inside the battery config:

path = “/sys/class/power_supply/BAT1/uevent”

The location might differ, so navigate to power_supply and find the BATX appropriate for you. I’ve seen someone use BAT%d in their config (%d would refer to an integer), but I havn’t tested it.

i3status should now automatically detect your battery, log out or reboot to see the changes.

How to set up Syslog-ng server on Debian

Syslog is a great standard for handling logs, especially over a network. So how do you set it up on Debian? Sending logs over a network isn’t rocket science.

Step 1 – install syslog-ng

First, run “sudo apt-get update” and “sudo apt-get upgrade” in order to update your packages. Then install syslog-ng with “sudo apt-get install syslog-ng”. Repeat this on all systems which should use syslog.

Step 2 – configure the clients

Open up “/etc/syslog-ng/syslog-ng.conf”, scroll down to the bottom and write:

destination d_tcp { tcp(“192.168.1.100” port(1234) localport(999)); };
log { source(s_src); destination(d_tcp); };

The first line defines a destination called d_tcp, which is a TCP connection to 192.168.1.100 on port 1234 from the local port 999. You should make sure that the IP is the IP of your syslog server. You may need to change the ports, depending on your configuration.

The second line tells syslog to send everything from s_scr (which is already defines, and has everything we need) to d_tcp. Basically, everything is sent to your server.

Do this for all clients.

Step 3- configure the server

Open up “/etc/syslog-ng/syslog-ng.conf”, scroll down to the bottom and write:

source s_net { tcp(ip(192.168.1.100) port(1234)); };

destination collector {
file(“/var/log/HOSTS/$HOST/$YEAR/$MONTH/$DAY/$FACILITY.log”
owner(root) group(root) perm(0600) dir_perm(0700) create_dirs(yes)
);
};

log { source(s_net); destination(collector); };

The first line defines a source, which listens on TCP port 1234 and IP 192.168.1.100. Modify this to match your environment.

Collector is a destination which, just like d_tcp, defines where stuff goes. Here we want to write a file and automatically create folders depending on time, host and what type of log entry. The $-sign in the path means it’s a variable.

And, just like before, the last line makes sure everything we collect from s_net goes to the proper destination.

If everything works as it should, you’ll see a folder HOSTS in /var/log, which in turn contains one folder per host that is sending logs.

Netseclab – nu lossnade det!

Eller hur är det frustrerande när saker och ting inte fungerar som man vill? Särskilt teknik. Särskilt när man inte ser varför det inte fungerar.

I tillämpad nätverkssäkerhet så ska vi sätta upp ett par maskiner och säkra upp dem så att vi ser om något händer… och vad som händer. Det finns, på gott och ont, en hel del verktyg att tillgå.

Snort

base För att övervaka nätverket drog vi igång snort med acidbase. Ger en helt okej överblick och är snällt att använda. Datorn är kopplad till en Switched Port Analyzer (SPAN), och kan därför se all trafik på hela nätverket. Om man sitter fast kan jag rekommendera att läsa http://www.aboutdebian.com/snort.htm

Syslog

analyzerMen det räcker inte att se skiten på nätverket, om man inte kan se vad som sker i datorerna. När man väl har förstått hur syslog fungerar så är det inga problem att använda det, men det är en rätt tuff tröskel att ta sig över. Att få in en webbfront tog också sin lilla stund.

Jag och min labbkamrat satt först och försökte få OSSIM att fungera, men utan vidare framsteg. Bara för att det är enklare innebär inte att det… ja… är enklare.

Bastion Review

Bastion
Playtime: 6h, easily replayable another 6h.
Genre: Adventure
Rating: 8/10

Such a great game, with such an awesome narrating. Story and art comes together to form something very well.

The levels are beautiful, and said to be hand-drawn. The levels feature a lot of detail, and an unique style. As you play, the world forms around your character, which makes it that much more interesting when it comes to exploring the map. You don’t know if you can walk a certain path, until you’ve tried.

Talking about art – the music is great. It blends very well in with the rest of the game. You can listen to the soundtrack out of the game, and really enjoy it. At times you might hear the same track over and over, but it really doesn’t matter.

So yeah, it’s a great view, but what about gameplay? Well, Bastion features nothing unique here, but it performs very well. You have a primary and secondary weapon (select and mix as you want) together with a “secret skill”, which is some kind of combat ability. You want to use that shield of yours a lot, and time it well, as you can counter incoming attacks and retaliate. Fights are fast-paced and requires skill in order to be efficient.

I appreciate the story and how it’s being told. Throughout the game you’ll hear a stranger narrating what’s happening as you go along. You are, in a way, experiencing the story as it’s being told. It’s a great approach, and Bastion does it exceedingly well. Without this, Bastion would be just another 3rd-person adventure game.

Positive:
Great art and music.
Challenging levels.
“Proving gounds” testing your abilities.
Replayable (you can even bring all your previous gear with you into a new game!)
Great story.

Negative:
The optional reflection-levels might get a little repetitive.

Bottom line: An amazing single-player experience.

Automate EVERYTHING

There’s a certain beauty to automatization. The machine works silently, completing time-wasting tasks for you, while you spend your time doing things that matter.

I like to keep my computer tidy – a cluttered desktop just makes me frustrated. Why? Because it takes forever to find something in a digital mess. The desktop tends to become cluttered, however, because cleaning isn’t fun. Moving icons to the right folders is in many ways just like cleaning, and cleaning is a chore. Chores are for the most part never fun.

To battle this, I wrote a script some time back which cleaned my desktop once per boot and put the contents into a folder with today’s date. With the hard drive storage capacity available, storing the vast amounts of files isn’t an issue. I have a lot of trash stored, but it’s easy to navigate and it keeps my desktop tidy.

Today, I took care of another issue. How do you keep track of your files if you have two computers? How do you transfer files? And why should you have to spend time on moving files? I bought a new laptop for school and work, which meant I had to find a way to move files. Windows file sharing works, but it’s time consuming. Dropbox could eliminate the problem, but it’s not suitable for large amounts of data. I do use Dropbox if it’s important only to have one version of the file, or if I need to access it on other devices, however.

I wrote another script as the solution. Every time i log on, it moves all the contents of an upload-folder to my server if I’m connected to my home network. This way, I can drop files into the folder, and forget about them. The script also downloads all files from a remote folder, and stores them locally in another folder. Essentially, I can move files asynchronous via a server.

All of this took some time to set up, but I’ll save more time in the long run.

Egna projekt

Någonstans under berget av läxor var det lätt att tappa poängen med vad skolan egentligen är till för. Skoltvånget, något på gott och ont, sågs negativt. Det var lätt att få för sig att skolan var ett ställe där man satt av sin tid och behövde komma ihåg en serie av tråkiga fakta.

Men ju roligare kurser man läser, ju mer kommer poängen tillbaka. Skolan är inte något man måste göra, kunskap är inte något man måste ta in. Om man vill lära sig något eller inte är ett aktivt val man gör som individ, och det man lär sig kan då ses som ett intresseområde. Det gäller i vart fall när man går på högskola. För, helt ärligt, man vore galen om man tog studielån för att plåga sig själv med ointressanta ämnen.

Därför är det helt okej att sitta långa timmar och studera. Det är intressant, någon mer anledning behövs inte. Fast, ja, att kunna tjäna pengar på det sen är väl fördelaktigt.

Jag känner till ett par som har egna projekt vid sidan om studierna, inklusive mig själv. Det kan vara föreningar, företag eller små hobbyprojekt – någonting som utvecklar personerna. Att ha egna projekt är givande. Det är så pass givande att det till och med ingår i min utbildning att arbeta med ett projekt mot kund.