Daniel's Blog
daniel@main~$ gcc blog.c -o blog && ./blog

It's time to end it all.

30/6/2017

I'm not happy with life, I haven't been in a long time - I don't think this is much of a secret, if you knew me to any extent you would surely know. For the last 3 or so years my life has consisted of nothing other than playing Counter Strike and moderating the r/globaloffensive community (although that part has only been a thing for 8 or 9 months at this point). Thrown in I have also been trying to complete my final year of high school - 3 years, I still have not finished.

I can't go on like this, currently I have no plans, I have no dream, I have no future. I need something to change and I need it now.

The day before last I left the r/globaloffensive Discord and IRC channel, I have no interest in furthering myself with those two hangouts. I'm currently planning on leaving the r/globaloffensive mod team entirely sometime after the current trial period. I feel like such a failure doing so before even the one year mark - the amount of effort and time I put into that place is insane, none of it benefits me in the real world, so why?

I have also decided to no longer play Counter Strike. my valuable skins have been moved to their original home (given to me by the one person I ever actually had fun playing with) and I only intend to play once weekly to complete the current operation.

All this isn't without reason. I am going to begin furthering my education by both attending and completing school and focussing on developing my programming knowledge. I have also began work on a portfolio showcasing a number of my projects.

After 2.2 thousand hours in Counter Strike Global Offensive I think I have well and truly had my $15 of enjoyment.

This is hopefully a turning point in my life - i pray that it is otherwise the alternative is ugly.

I didn't say goodbye to anyone in either of the communities I left, if you cared about my presence and am wondering why I left, i'm sorry.


RGB controller web page

4/6/2017

I've now integrated a server into my RGB controller that allows outside applications to send commands over a socket. The first project using this feature is an HTML/JS web page that uses PHP to send the commands. I have these running on a local server running a LAMP stack.

This addition broadens the future of this application and the things I can one day do.


RGB Controller improvements

21/5/2017

Recently I decided to overhaul my RGB Controller's interface. Originally, the interface was extremely tall consisting of all its features one upon the other. Now, I have used tabs allowing each function to have it's own section.

Along with the new interface I have added a new system that allows the host computer to check its connection status with the microcontroller, after 3 failed ping/pong attempts the program determines the connection has been lost and returns te program into it's default, non connect state. This feature has brought with it true two-way communication between the host and microcontrollrer, previously the communication was only one way, host -> microcontroller.

I have also integrated an IRC bot into the program, supplying it with a server, port, channel name and username you are able to take advantage of the full feature set of the GUI application using simple commands, "!send red=255" will for example set red to 255. These commands can be delimited by ';', for example "!send red=255;blue=255". The bot only takes commands from a hard coded user, this is easy to change and I plan to add an option in the UI to alter this.

Example of the current interface on the 'Fade' tab.


CS:GO bomb drop bind and how I overcame its one downside

2/5/2017

recently I was shown a bind for CS:GO that automatically switches to your bomb and drops it. This is great, however it has one problem: if you aren't in possesion of the bomb it throws your current weapon.

Of course, me being myself this was unacceptable, I had played a few games of matchmaking with this bind and I had dropped my gun by accident too many times (I bound it to mouse3, I also press mouse3 in game sometimes). The bind in question is bind mouse3 "use weapon_c4;drop".

Using Qt/C++ I created a console application that uses CSGO's game state integration to read current information form the game client. I have used this (and most of the code, too) in my CSGO stats application which had a feature rich game display using game state integration.

The application is simple, when the game detects you're currently in possesion of the bomb it writes the drop bomb bind to a cfg file, when it detects you don't have the bomb, it instead does nothing, in the case of this video it prints "I don't have the bomb". The cfg file is only written if the state changes, it isn't constantly writing to the file, that would be grossly inefficient.

Here you can see the program in use:
video


In need of a notification program, so I created my own

28/4/2017

While uploading an image to my file hosting service using the api and a script utilising curl, scrot and xclip I was left pasting the contents of my clipboard into the url bar hoping that, eventually the image url would be there. The script I was using had no way of reporting that it had finished, so I had no clue when it was. To solve this first world problem I needed a notification program. While installing one and configuring it would have been the easiest option, I instead decided to create my own. Using, like all my other projects, Qt and C++ I did just that.

The application is incredibly simple, however is very effective. The following command is what was used to create the notification seen in the image:
notifier "<b><u>Screenshot</u></b>" "<font color=green>uploaded and copied to clipboard.</font>" 5000
HTML tags are supported, allowing you to customise the text completely, you can also embed images. The top right includes a close button for easy removal and the application allows input of how long it should stay open until it closes itself, this is measured in ms. The notification appears correctly in the bottom right of my main monitor and has a customisable x and y offset. It resizes itself dynamically to keep all the content on screen.

The project is not as of yet on GitHub, i'm not happy with the quality of the code yet.


Sorting images from log files

24/4/2017

Recently i've been wanting to collect and store images (mostly reaction images/anime screenshots) that have been posted in a specific IRC channel.
To accomplish this I decided to take the DIY route and create my own scripts/applications.

Collecting the images

The first issue I encountered was collecting the images from IRC logs. Being a Linux user I knew this wouldn't be too difficult, and it wasn't, infact it was amazingly simple. First thing to do was collect all the log files from ZNC and place them into a directory. This was done with the following command
cp ~/.znc/moddata/logs/zncname_servername_#channel* ~/whereever/you/want
With the logs collected the next step was parsing the urls of jpgs, gifs and pngs out of the logs. From there, a directory for the images we download has to be made. The last step is downloading the images, this was accomplished using wget with -i indicating a file of urls to download and --directory-prefix indicating the location images should be downloaded to.
This was done through the following bash script.
#!/bin/bash
echo 'run this in the directory containing all your logs (not recursive)'
cat *.log | egrep -o 'https?://[^ ]+.png' >> files.txt
cat *.log | egrep -o 'https?://[^ ]+.jpg' >> files.txt
cat *.log | egrep -o 'https?://[^ ]+.gif' >> files.txt
mkdir images
wget -i "files.txt" --directory-prefix=images

Sorting the images

With the thousands upon thousands of images collected (at this point I realised this project was unrealistic, I only continued because the application and scripts created are actually useful) I needed a way to name them. I like to keep my image names descriptive, perfect for finding them in a short period of time (aka sending them to people in response to questions). Using Qt and C++ I created a simple image viewer that supports GIF/PNG/JPG that allows me to select a directory and rename each image. Renamed images are moved into a directory named "sorted". You can also delete images, this was a crucial feature as a number of the images downloaded from the logs were not of any use to my collection.


The code for this project can be found on GitHub
Also been working hard on my cheats. Come on now, Melbourne is not Adelaide.


How I do what I do with my computer

29/3/2017

I've never gone in depth on how I use my computer and the things that I do every day, so i'm going to now.

My environment

For a few years now I have run only Linux and have found myself ending up on Arch Linux. I use the i3 window manager, I have not riced my computer, I find it to be unproductive and a hassle. I prefer to spend most of my time in the terminal, therefore I do not have a graphical file manager, I use a terminal-based music player, do my programming in vim and other things that don't need mentioning (password management etc). I use tmux for terminal multiplexing and I use lxterminal.

i3 setup

I use dmenu for application launching, i3blocks as a status bar and heavily utilise i3 scripting for many of my system shortcuts.

i3blocks

I currently utilise 7 desktops, each have their own purpose.
  • Main - This is used to store my web browser (conkeror) and terminals that I immediately use/need. This is also the desktop I store the game I play (only CSGO).
  • Music - This desktop is dedicated ONLY to a single terminal running cmus.
  • Steam - I use this desktop ONLY for storing the steam client.
  • Videos - I use this desktop to store a terminal running Ranger (terminal filemanager) in which I open my anime/movies/whatever with, I also store the mplayer window here.
  • Moderation - This desktop is dedicated ONLY to Reddit moderation windows. I run a second irssi session on this desktop connected to a Slack gateway. I have two FireFox windows open, each with their own dedicated reddit pages (mod queue, /new etc). This is ALL I use FireFox for, I use conkeror for my personal browsing.
  • Programming - This desktop is where I run a single terminal session running tmux. I split the terminal into two, more details on how I do my programming will come later. I also run a conkeror session in this desktop that I use to access language documentation/stackoverflow.

Programming environment

In progress.


New project implementations

1/3/2017

Over the last few days I have created two new projects that utilise the core concepts (and most of the code base) of two previousprojects - my RGB controller and CS:GO stat viewer.
The first project is a command-line implementation of my RGB controller. Using C++ and Qt (as with most of my other projects) a console application was created that allows me to send commands to my RGB controller (micro-controller based) over a serial connection.
The application expects at least two arguments: the first being the device to write to (serial port) the second a command to send. Each argument (delimited with a sapce) is sent, one after the other for processing on the micro-controller.
Example usage:

  ./rgb ttyUSB0 rf=100 rt=255 redfade  
This command will connect to the serial device ttyUSB0, set the "red from" value to 100, thie "red to" value to 255 and toggle fading of the red LEDs. "red from" and "red to" means the red LEDs will fade from the value 100 to 255 repeatedly. If no arguments are given the program will give you al sit of available serial ports to select from.
The other project is a portable api using Qt libraries for accessing CS:GO api data easily. It requires you to provide a STEAM64ID, it then access the CS:GO api and parses and stores information in easily accessible variables and arrays.
Example usage (click on the image to make it bigger):


RGB controller revisted

16/2/2017

Over the past few days I have revisted my RGB controller project. The state of the project was stale and I didn't appreciate how I went about making the microcontroller side of things work. I began by revamping the microcontroller code, I changed how serial data was handled and parsed - this allowed me to add aditional functions other thaqn plain old R, G and B color modifications. I began experimenting with color fading, I thought the results were nice, however I had to taclke the issue of scheduling (psuedo multithreading), I managed to find a nice library that allowed me to do this easily. I integrated fading and many other options to go along with it (more on that later) and began revamping my user interface and the code behind the frontend of the project. To fit with the new data communication scheme I had to rewrite most of my communication functions, adding a few etc. Once this was done I integrated a new section to the user interface named "fade". Here is screenshot of the additions.


New features:

  • red, green and blue color fading each with their own toggle buttons (can pause a specific color etc)
  • individual color fading on their own timers (each color can fade faster or slower than the rest)
  • minimum and maximum fade values from 0 to 255 available for each color
  • speed control of all colors using one slider
As always, you can find the project on GitHub
. This has been the only spark of motivation for programming i've had in a long time. This is ultimately depressing.


The end of 2016 and my future

7/12/2016

As 2016 comes to an end it's time to reflect upon the year. Drama wise, it has been the best yet, the US election specifically and lately, the Reddit drama with Spez - I love drama.
However, on a personal level, this year has been different from any other in many ways. I began 2016 motivated to finally be done with school, and it went well up until August, I was so close, literally weeks away. But I lost grasp of everything, I fell once again into a pit of depressive nothingness. During August I had broken my shoulder, I was in agony for around two or so months, not able to use my left arm. As a left handed individual this was incredibly depressing. I had to relearn how to do everything with only my right hand, I couldn't play CS:GO and I couldn't type at a reasonable pace with only my non-dominate hand. It was around October I was finally able to start re-using my left hand for basic tasks, I could finally shower and sleep without incredible pain. Around November I finally regained my left arm enough to do most things. To this day I still have shoulder pain when lifting things and sleeping on my side and fear it will never go away.
At this point all my school work was due, it had piled up during the last few months, I hadn't done any of it, I had to rush everything. I managed to complete my Research Project start to finish in only a week, I don't know how I managed. However it was too late. The deadlines had come and gone, and I told school to have me back for 2017. I fucking promised myself I wouldn't be in the same position at the end of 2016 as I was at the conclusion of 2015, but I am, once again I have spent a year and achieved nothing. Many other things have happened to me this year, all of which are personal and horrible, however you do not need to know any of it.

Ending on a positive note

This year hasn't been all bad. Around two months ago I had been accepted into a trial moderation program for the subreddit r/GlobalOffensive with around half a million subscribers, this is a subreddit dedicated to the only game I have ever truly enjoyed and have sunk nearly 2 thousand hours into - Counter Strike Global Offensive. I've spent the last four years of my life on IRC and with that came some moderation duties on the BeamNG IRC channel and I found it incredibly fun. When I noticed this particular subreddit accepting moderator applications I knew I had to apply. 0 expectations going in, as with everything in life of course, however this time I came out a winner. Fast forward a month out of the 11 accepted applicants I was one of the four accepted as a moderator. This is fun, the last two or so months have been entirely taken by moderating the subreddit and interacting with the community both via IRC and Discord. How long will this enjoyment last? Probably not long, but I shall enjoy it while it lasts.
u/daniel_j-


Something different

30/10/2016

With another month gone by it is probably time for blog post.
School is continuing next year... I thought it'd be over this year, but I just was not up for the work. That's mighty depressing. It wont be all of next year, hopefully I will be done within the first semester.
I have done no programming this month which is mighty depressing, I need to start another project, but ideas have run dry.


I don't know what to do.

2/10/2016

I am currently in the home-stretch of recovering from my shoulder injury. I have limited, yet existing movement with my left arm and can use it for basic things, but it still hurts. I am use to doing this with my right arm now - I'm not sure if I will go back to using my left.
I have lately been playing CS:GO again. I have changed a lot of my config. My crosshair, sitting position and style, resolution, sensitivity all has been altered. I took this injury as a chance to rethink how I play as I was not progressing. I don't know if I will play CS:GO much longer. I love it, but at the same time I am sick of it.
Programming, something I love is always getting old for me. I have been using C lately and have made a cool thing or two, however ideas have stopped flowing and I am once again bored. I need a project, I need ideas.
2016 is nearing its end and I am in the same position as I was this time last year. I was supposed to be finished with highschool in 2016, however for reasons talked about before, I am here, at the end of 2016 still procrastinating, still wondering if I will complete. I am over it, sick of it, yet cannot find the motivation to finish it.

Maybe I am not motivated to finish because I don't know what the future holds? I want to become a software developer, programming is the only thing I really enjoy - but how. University is a stretch, the way I am completing high school does not lead into university - thus I'd have ot take one of the other routes, an extrance exam. But, that leads to another issue. Software development courses have math knowledge requirements that far surpass my knowledge. I have nto taken any of the prerequisit classes.

I don't know where to go from here, but what I do know is my posts seem to have a constant pattern of being a month apart, this is not intentional, it has just happened that way.

Does anyone read these posts? Who am I really talking to, maybe my future self, or maybe a future employer looking into my online history? Don't worry, just stay here and on GitHub.


Broken shoulder, everything is on hold.

1/9/2016

Unfortunately a few weeks ago I had somewhat of an accident and broke my left shoulder - my dominant arm. This has made just about everything difficult. I have not had a good nights sleep in weeks and I cannot do anything I enjoy. I am in a sling for another 10 weeks, lets hope it goes fast.
No CS:GO or programming makes Daniel something .. something.
But, negativity out of the way, some cool new things have come about since my last post.

IRC Web client

I have now installed QWEBIRC onto this server which allows you to connect to my IRC network via your web browser.
You can find the service here.

File hosting

I now run a temporary file hosting service - perfect for when you need to share small files with others over the internet. You can find the service here.

CS:GO stats viewer

A lot of work has gone into my stats viewer since I last talked about it.
The biggest is game integration. Game integration sues the local CS:GO API provided to give real-time in-game statistics about your current match.
However, since I cannot play CS:GO for the time being because of my shoulder, work on this project has been halted. You can find the project on GitHub.


CS:GO Stats viewer

1/8/2016

For the past week or so I have been working on a new project that displays a users Counter Strike: Global Offensive in-game statistics.
Using Steam's API a user is given access to an abundant amount of statistics about a given users Steam account and in-game information, in the case of a Valve owned title CS:GO, much of this information is of great importance to a player trying to improve their overall skill and performance.
I have utilised this API to its full advantage and have designed a multi-platform program that can present this information to you in a user-friendly manner.
This project was written using C++ and the QT framework, the code is open source and available on GitHub.
Features

    Profile selection - choose, edit, delete and save any number of users for quick access to their statistics. These profiles are written to file and saved for later use. (select the user you want to view from the dropdown menu)
    In-depth Weapon statistics including the total number of kills, shots, hit and your shots/hits ratio.
    In-depth Map statistics including total rounds played, rounds lost/win and the ratio of wins to losses.
    Generic Steam profile statistics such as your profile picture, username, real name and time played in CS:GO
    Other important CS:GO information such as MVPs earned, total kills achieved, total deaths and your kill/death ratio.
This is an on-going project that I am currently quite interested in and plan to expand further with more in-game statistics and stat-tracking to keep tab on your progress (pun intended).
Here is what the UI currently looks like - there are three copies open, one showing my main CS:GO account, the other my alt and the last the user interfaces for selecting and editing users stored on disc.


My RGB LED project - something I actually enjoy working on.

1/7/2016

For a while now I have been working on my RGB controller and have made some great progress - the most recent being that of presets. The ability to load, select, save and delete presets has been one I have wanted for a long time yet have never actually attempted to do.
This project allows me to control my rooms RGB LED lighting from software I have written on my computer. This project uses a combination of C/C++ and the Qt library, the LED strip itself is powered by an Arduino - the two way communication is achieved via serial libraries. This project is being featured in a major school project about serial communication - I may post that project here at some point. This project can be found on GitHub. This is the current state of the UI.


Don't try too hard - Linux makes life easy.

29/5/2016

For a long time now I have, on multiple occasions went to create an image uploading program simmilar to the Windows software ShareX. Albeit, I only needed a simple "select area of the screen and upload the file to a web-server" deal - I still managed to give up, every. single. time.
I had searched for software compatible with Linux that did this and I just couldn't find any that fit my needs. But, I had an idea I hadn't considered - what if I use multiple pieces of software, combined with bash to make a simple. one lined solution? To my surprise, this worked.
The software starred in this project includes scrot, sftp and xclip.
Here is the one line bash script I use
scrot -s ~/screenshots/%b%d::%H%M%S.png -e 'sftp -P 6669 daniel@danieljon.es:/var/www/images/ <<< $"put $f"; echo https:/danieljon.es/images/$n | xclip -selection c'
It is pretty simple, first it launches scrot (a screenshotting tool) with the option -s which allows the user to select an area of the screen to capture, then it specifies a location and name of the image to be saved, next it uses the -e option to execute a command - I use SFTP to connect to my server (I use SSH keys, no passwords), 'put' the SFTP command put is used to upload the image. Note the $f, this specifies the file location and name of the image we captured. Next I pipe the location of the image into xclip which copies the final link to the image in my clipboard.
Linux is awesome.


Presets recreated within my RGB controller

27/5/2016

You may have read about the presets function I added to my RGB controller a few months back .. it was horrible and literally straight after writing that post, I removed it. Tonight I decided to re-create it using a drop down box, and this time it works. I am re-using this RGB controller as the star of my research project - a required project to achieve the completion of high school, it might be cheating, but I don't care.


Research Project - How I plan for failure.

23/5/2016

I'd like to post this little masterpiece I just wrote up.
This is how I plan things - not good.
Failure seems to be my end goal, but is it?

 so, I really need to get a move on and get my research project done



I don't want to bother handing this project in if it isn't of above-medium standards because that makes all of this a waste of time.

If I ever think it is shit - I am dumping it all.

Or maybe I won't, I really, really don't care about any of it right now.

-------------------------------------------------------------------

Things I have finished:

        - RGB LED project.

                I have it done, all the programming etc, and it works. In fact, I have been using it for months - way before I even considered it for this subject, yes, i'm not going to learn anything.

Things I need to do:

        - proposal

                I want 1.5-2k words, maybe more.

        - research process

                I have no damn clue what I am going to do here. Have to pull something out of thin air I guess .. about 9 pages of it too.

        - log of every session

                This may actually be done legit, because, let's be honest, I've really done nothing, so the entries can be made up.. on the actual dates.

        - final outcome

        - review



So, what the hell is my final outcome anyway?

        - Website - static JS, HTML, CSS - NO PHP, sadly it needs to be handed in via USB.

                how will they view it?

                        - they will need to open a page called index.html in their browser .. if they cannot manage this I really don't care for their marks/grades

        - Video of the project (I am not a graphical artist/into video editing, it will be a horrible video - editing wise)

                (AFTER THOUGHT: the video will basically be a power point presentation, with little video clips and voice overs in it, that counts, right)

                what will it contain?

                        - Entire video will be voiced over

                        - brief introduction of myself? (seems kinda gay)

                        - motivation behind the project

                                should this be an outline of my proposal?

                        - graphical schematics of the project and UI designs with explanations of my reasons behind things, simmilar ot ins the proposal

                                these will be static images with voice over

                        - parts list

                                insert pictures of each part, maybe talk about their purpose

                        - show pictures of it being put together - of course I will have to take it apart and put it back together, because all of this is basically a lie

                        - talk about challenges I faced constructing it - I did encounter issues .. just not now, about 6 months ago when I originally made it maybe even longer, I hope they don't look at my blog posts about it

                will it be on YouTube?

                        - no, it will be an mp4 file located on the USB drive submitted

  


Small tantrum

20/5/2016

It has been a little while since my last blog post, and I have nothing to talk about.
I am stuck in a torrent of nothingness. Nothing excites me, nothing is making me happy. I am not progressing my skills in programming, nor am I progressing through school. Worse yet, I have been unable to maintain any form of 'skill' in counter strike. I cannot make the simpliest of kills - my aim is very off, my spray control is down-right embarassing and I am soon going to derank.
What does it take to be happy? Who knows, I certainly don't.
Maybe, just maybe I need to leave my computer for a little while and have some form of life experience - but that isn't going to happen. So here's to another week of mundane day-in-the-life animes desu and boredom.


CS:GO statistics

4/5/2016

A new item has found its way onto the side navigation bar of my website. Under the label "CS:GO statistics" you will find a page full of information taken from public Steam APIs, specifically that of Counter Strike Global Offensive. I have created a dynamic way to retrieve users statistics, all that is needed is their public Steam ID. I created this page to allow myself to compare my own statistics to that of my close gaming friends. It is ugly, but does the trick.
You can find the project on GitHub here.


Micro USB Digispark Pro issues and how I solved them

26/4/2016

EDIT: It seems communication via USB is possible via this library. I am as happy as ever!
EDIT: I shorted the board and it is dead, I give up on electronics.

Today I received a recent, off-the-whim Ebay purchase - a Digispark Pro microprocessor. The product was cheap and to be honest I kind of expected it to be a fake/remake (and to be honest I can't tell if it is). The one I purchased can be found here.
Like with everything in life I did zero research and happily accepted what the listing described to me - what a stupid mistake. I won't go into why it isn't what I expected, however, I can happily say THIS BOARD DOES NOT SUPPORT SERIAL COMMUNICATION! Be warned, don't learn the hard way and waste five dollars. (I bought this product for serial communication in a project, that to me is hilarious)
For once, however this post isn't about bitching, instead, it is how I managed to get code uploaded to this board via the Arduino IDE on a Linux system.
I am running a 64bit Arch Linux installation - this shouldn't really matter, however. If your problem is with Windows, I can't help you.

The first issue I encountered and the solution I found:
I can't find the board in the serial port list and dmesg gives me an output simmilar to this:
[369166.755711] usb 2-1.8: device not accepting address 87, error -32
[369166.755890] usb 2-1-port8: unable to enumerate USB device

When I encountered this error I had tried many things including changing USB port, micro USB cable and using another Linux system the result however, on each attempt was the same. It just didn't seem like it was working.
Now, the answer to this is not simple, and I won't be explaining it, but let it be known, this device does not appear as a standard ttyUSB device when in use. So, how do you upload code? Well, for five seconds upon initial USB connection your computer and thus the program used to upload code (more on this soon) can communicate with the board for a short ammount of time. I have found supposed libraries that allow you to communicate with the board via serial during use, however I have not tested nor used them and can't give an opinion on the subject. (see this for more information)
So, how do I fix the errors? You don't, I guess, it is supposed to do that, and even now, once I managed to get code running on the boad, the same errors occur. (probably due to this board not being meant to be connected via USB for anything more than code upload)

Great, we now know that we are not meant to see this board in our serial list and that dmesg errors are normal, but how do I upload code to the board?
Be warned, the fun starts now and I suggest you have some command line knowledge before continuing.
Now, the first thing that needs to be done is to set your Arduino IDE up to use the Digistump package that includes the piece of software that is the centre of this post, micronucleus.
You must at this point follow the tutorial here in its entirety!
If, after you follow the tutorial linked above you are able to upload code to your board without a hitch, great! You don't need to read on, go enjoy your new microprocessor.
however, if at this point the Arduino IDE spits out the following:
Warning: device with unknown new version of Micronucleus detected.
This tool doesn't know how to upload to this new device. Updates may be available.
Device reports version as: 2.2

You have a little work to do yet! But don't fret, the solution is simple.
It seems the version of the Micronucleus bootloader on Digispark boards (in my case at least) is newer than what comes with the Arduino software you installed earlier in this tutorial. To fix this issue, we just need to replace it with a newer version!
I'm going to go through the steps assuming you know what the commands do, if not, why are you playing with a microcontrller on Linux anyway?
First, we will make a directory in which we will install and compile the newer version of Micronucleus.
mkdir ~/compiled
mkdir ~/compiled/micronucleus

Next we will clone the Github repository of the project. I assume you have Git installed, if not, Google is your friend.
cd ~/compiled/micronucleus
git clone https://github.com/micronucleus/micronucleus/
Next we will compile the code into a binary that will replace the version in use now. I also assume you have development libraries installed.
cd ~/compiled/micronucleus/micronucleus-master/commandline/ make
Now the new version of Micronucleus is compiled and ready to be switched with the current version in use by the Arduino IDE. (your directory structure may differ sightly)
#backup the old micronucleus binary just in case we need it later
mv ~/.arduino15/packages/digistump/tools/micronucleus/2.0a4/micronucleus ~/.arduino15/packages/digistump/tools/micronucleus/2.0a4/micronucleus_old
#copy our new compiled binary to replace the one we just backed up
cp ~/compiled/micronucleus/micronucleus-master/commandline/micronucleus ~/.arduino15/packages/digistump/tools/micronucleus/2.0a4/micronucleus
Now that an up to date version of Micronucleus is installed you should now be able to upload code to your Digispark microcontroller - well, I could at least!
At this point I shall also warn you that I only managed to get Micronucleus running correctly if I opened the Arduino IDE as root, now, I suspect there is a solution for that out there, but I am yet to come accross it.
My experience using the Digispark pro microcontroller spans over a few hours as I received the product earlier today, but I have learnt a lot, and can hopefully help someone else one day.


How I use my new blogging system

11/4/2016

As pointed out in an earlier blog post I have recently transitioned from the blogging package known as WordPress to my own system that I feel is nicer to use and has little to no exploitable features.
I'd like to point out a few things - how I create a new blog post, how I display then on my page and how my site is setup.

Creating a new blog post

Creating a new post is easy due to how modular my system is - I will go into further detail of this modularity a little later. I create each and every blog post in its own php file in pure HTML (you can find them all here). I create and edit each blog post through an SSH connection using vim, I begin by copying the template.file into post_number.php and edit that file accordingly. This template has a basic blog post outline inside it and an example of how I should insert pictures into my posts with 404 fallbacks. Of course, having blogs be pure php files I can easily screw everything on my page up, and if a malicious blog post is written, do nasty things to my server. But with such risks comes the ease of backing up my posts and transfering them between servers.

Displaying the posts on my blog page

The system I use for displaying my blog posts may not be very safe or light but my god does it make things easy. I begin by getting a count of all files inside the 'posts' directory that end in .php, this is NOT safe AT ALL, but I don't plan on putting anything in this directory other than posts. I then use a for loop to count down to 1 from the number of php file we collected before, using this decrementing number I use the php include funtion to paste the contents of that particular file into my blog. Pretty simple, yet effective.
Here is an outline of the code that does this.

 

$total = count(glob("posts/*.php", GLOB_BRACE));

for ($total; $total >= 1; $total--)

{

	include('posts/' . $total . '.php');

}

How my website is setup

Moving from WordPress to my own setup allowed me to do things how I wanted - I prefer simple things, a simple website with a minimalistic design, and that is what I did.

Directory structures

Inside my www root I have 3 directories of interest: blog, includes and css. They each contain exactly what is stated - the blog directory holds my blog and its files, the includes directory contains files that I use regularly for web-design (more on this later) and the css directory contains all my css source files.
Inside my blog directory I have one other directory of interest: posts, which contains all of my blog posts and a single subdirectory named media, which, you guessed it, contains the media used inside my blog posts.

Files of interest and what they are used for

Generally, I have only two files of interest that may be of interest to you, one being the side navigation bar and my css source file.
Located at /includes/navbar.php is thenavigation bar you see to your left when using my site. It is a single php file that is included when and where I need it. It derives its layout from the style.css file.
Located at /css/style.css is my css source file that dictates the look and feel of my website and blog; it is pretty simple but works great.
All files I need are referenced locally (for example ../../includes/navbar.php).
For the hell of it, here is a picture of this blog upon completion inside my vim editor. It may look like jargon to you, but it looks like a blog post to me. pssst, you can click on the image to get a larger view.


New server, now running my own e-mail server

8/4/2016

The world still exists, amazing.
have spent the last two days setting up and configuring a new server that will, in-time replace the one I was once using for everything.
Things setup:

  • LAMP server (Apache, MySQL, PHP)
  • IRC Server
  • ZNC IRC bouncer
  • Multiple adminstration panels
  • My personal website/blog
  • tankfootball.com and its website (the owner has to do his part yet)
  • fail2ban
  • Properly secured SSH/SFTP
  • Mail server (virus scanning, spam filters, etc)
Things that still need to be done:
  • xmx.fyi image hosting (still running on the old server)
  • dummiesman.com (I need his cooperation, but he isn't responding)
  • MySQL database migration (I am really just too lazy for this now)
This is my first time configuring and administering an e-mail server and it has gone amazingly well so far.
I do need help however.
I need to know what e-mail hosting websites/services tag my email as spam/junk, it'd be great if you could send me an email at admin@danieljon.es naming the service you are using, i'll then reply and get you to tell me if it was junked or set as spam!
Services known to mark my e-mail as spam/junk:
  • Outlook/Live mail
Services known to NOT mark my e-mail as spam/junk:
  • Gmail
Much appreciated.


Rid myself of WordPress

31/3/2016

Over the past few days I have been converting my WordPress blog posts and have integrated them into my own blog-like page.
WordPress is scary with all of its vulnerabilities, at least I now have security through obscurity!


My Arch Linux system - software I use daily and how I do what I do

12/3/2016

As a computer enthusiast I am quite surprised I haven't gone into detail about how I use my system and the hardware I run - so, lets do it.
A good start would of course be my physical hardware, I'm curently running:
- i7 3770k stock
- 16GB Hyper-X blu ddr3 memory
- Nvidia GTX 660Ti
- 128 GB main bootdrive SSD
- 2TB data storage HDD
- 1TB local backup HDD
- 2* Acer V243HQ monitors
- Razer Deathstalker keyboard
- Logitech G502 gaming mouse
- Logitech G230 headset
and, like any good *nix guy, a screenfetch (you can click on an image for a bigger view):

Now that the boring stuff is out of the way, lets get into the juicy software I use daily and the things I use them for!
[Operating System & Window Manager]
Arch Linux - Ah yes, good old Arch, I wont bother going into details, but it is what all the cool kids use ;)
i3 - This is a tiling window manager, of which I have covered before.
[Media & Media Management]
mplayer - this is a lightweight media player I use to watch .. things I have downloaded locally.
cmus - this is a terminal based msuic player that has one job, and does it exceedingly well, it plays my music! cmus has a nice commandline program that allows one to pause/play etc, this makes it easy to integrate into my key inputs such as my pause/play button etc
ranger - this is a terminal based file manager, I use it souley for selecting videos to play with mplayer, I do my general file management through the terminal.
[Entertainment]
ssh - Ah, good old ssh, I use this protocol to connect to my various servers and *nix boxes for remote server management, I, and many other people would be clueless as to what to do without ssh.
irssi - this is an Internet Relay Chat aka life client that I use over an ssh connection, I chat with many people around the world, I mainly hangout in programming/computer related channels, I also run my own IRC server, you can catch me over at irc.danieljon.es in #fun, identify yourself though, I remove anyone I don't know fast.
[Internet Browsing]
conkeror - this is an internet browser that is based upon FireFox and has the mind of a programmer - being lazy. It was created to be used without a mouse and has emacs-style key shortcuts, it has a large learning curve, but is very, very useful once you master it.
FireFox - this bastard program opens up when I open a link in irc because I'm too lazy to change the default program.
[Production]
lxterminal - this is a terminal emulator that I have recently decided to use, I was at one point using konsole, but its memory usage was just too high. This program is used to do many things: cmus, ranger, ssh, irssi, file management etc
vim - the enemy of emacs, this is an extremly powerful, terminal based text editor that I use for everything from writing notes, editing configuration files to programming in various languages - yes, I use vim instead of an actual IDE for programming, it just feels more comfortable to me.
[Local Media Server]
motion - I use motion on my media server to record via a camera mounted on my roof, it points towards our driveway, it is a good way to both know when people are coming/leaving and recording any no-gooders that may be in my area. I have it setup to take pictures when it detects motion - if I ever die bloody, check my media server for evidence!
apache2 - this is webserver software, I run it to provide me with an easy way to access my cameras stream.
tvheadend - this is DVR software, I use it to stream tv signals through my local network - although I don't really use it anymore.
If I have missed anything, I'll add to the list at a later date.
Resource usage:
I certainly am not lacking in resources, I generally keep my ram usage under 1gb, yes, I know, I have 16, I just like small numbers.


I love my setup and computer, I'd go ahead and provide some nice fancy images of both my setup and current desktop, but, I'm lazy.


All domains (that serve content) on my server now use SSL

2/3/2016

Thanks to LetsEncrypt all domains running on this server now enforce SSL.
Domains affected:
danieljon.es
xmx.fyi
dummiesman.com
tankfootball.com
This literally does nothing more for myself, or you than provide a fancy green lock in your browser, well, it does encrypt all your traffic, but we don't exactly provide services to many people.


SSH isn't playing ball nicely ... I just want to do [il]legal things.

18/2/2016

Recently we have switched ISPs, and with that came a monthly data allowance skyrocketing that of the measly 300GB we had previously.
There is no way of putting it nicely, I want to do illegal things and I do not want to be caught doing them, thus, I am suddenly in need of a way of protecting myself online, a VPN, and it just so happens that I have one floating around in use by a close few.
It was about damn time I used something I'm paying for.
Blah blah blah, an OpenVPN install and configuration later I was ready to connect to the service and begin muh illegalz.
I live my life through IRC. I'm on it all day every day, only missing a single line of text when i'm sleeping and I do this all through IRSSI running on my server. I connect to this server via the SSH protocol and thus, if SSH were to suddenly stop working, I would literally be clueless as to what to do.
I'm using IRSSI for IRC, I can't go back to a scrub X application, ew.
But, what do you know, SSH simply does not work through my VPN... or so I thought.
I was experiencing an issue initiating an initial connection to my server, when run in verbose mode the following line is where it hung everytime:
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Quick I thought, time to put my uber leet Linux skills to use, lets go to Google!
I quickly came across this bug report: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1254085
Interesting I thought; apparently other SSH clients can initiate a connection and work correctly!
So I went ahead and installed PuTTY (a GUI SSH client), and what do you know, I was able to connect without a single hitch!
So, it was at this point I knew it was specifically an OpenSSH client issue. Great, perfect, amazing.
It has been suggested to change MTU values on eth0 .. now i've tried this, however it just isn't working.
And that is that - even now, I cannot SSH into my server while using my VPN.
I bet you expected a happy ending, nope. I'm going to bed and just might cry.


Conkeror, Ranger and Cmus

11/2/2016

Chrome and VLC - the utter basics for any respectable computer owner. Both applicatons are cross-platform and run beautifully on Linux - great.
However, something all versions share is an extremely heavy footprint, RAM wise.
I had decided to stop using them.
Now with both of these applications gone I was then free to use my own alternatives - the choices were plentiful, but I settled on two applications. Conkeror and Cmus.
If you know me I like to make things difficult real difficult. I insisted I find myself a CLI (terminal based, no graphics etc) file browser and music player - as well as a really, really complicated web browser. And oh boy did I find them all.
Conkeror: Ah, the internet we all know, just in a really, really, really hard to learn manner! Conkeror is a purely keyboard driven web browser. Which means one thing, a mouse is no longer needed! Everything is driven with complicated fancy key combinations, you aren't interested, but if you are, you should totally check it out.
Ranger: Ranger is a purely CLI based file manager. It does exactly what "explorer" does in windows, except it is inside a terminal window. Simple!
The Ranger file manager:

Cmus: Cmus is, once again, a purely CLI application that has one job - play music! It accomplishes this by having its own in-buit file manager purely for music. You are able to save file locations etc. And it works great!
Cmus:

There is nothing more fun than learning new, difficult programs.


http://xmx.fyi/ our new image uploading service

4/2/2016

We're now up and running with a new, fully custom created (using PHP and MySQL) image uploader.
We currently have a register/login system running with image uploading. We're working on getting an image manager setup. Good times ahead, thanks Dummiesman!


Premature i3 window manager review

25/1/2016

It hasn't quite been a week, and I don't quite yet have it set-up exactly how I want it - but my god is it great.
First, you should know I'm fairly new to Linux, and am a complete noob.
I'm going to chop this little review up into multiple parts, ranging from the install and it's ease of use to the configuration and set-up of i3 add-ons.
But first, let me actually explain to you what the i3 window manager is.
A window manager is a piece (or collection) of software that has one job: control the border, appearance, location and maintenance of windows on the users desktop. This software also controls the functions you can use to resize, move and sometimes dock/stack windows. You use a Window manager every day. Windows has one, Apple systems too! You can learn more about a window manager here.
Before I began my journey into learning i3 I was using the default KDE window manager, kwin. And it was great.
Kwin was beautiful, and in-fact my first ever window manager. So why, one would ask would I want to switch from something I know so well, and is so familiar to that of a Windows system? Well, you literally just answered your own question, is what I would respond. I wanted something different, I was sick of having a computer look like almost every other personal computer out there - a task bar, icons, a start menu etc. I wanted to be a hipster - even more than I am now.
I'd love to stop right here and say that is the only thing that influenced my decision, but it wasn't.
I'm also lazy. I hate having to pick-up my arm and grab onto my mouse when doing something terminal based, such as programming. I wanted something that would give me full control of my windows and workspaces, I needed something for the elite, I needed a tiling window manager.
I began researching many tiling window managers, and I kept coming to a single conclusion - one that was above and beyond the rest. And so came i3.
But with i3 came a learning curve - one that was quick to learn, but vastly different from any other desktop experience I have ever had. I had to re-learn the basics of a computer. With i3 there is no minimise button, there is no maximise button and there is no close button. There is no dragging windows, or resizing windows. Instead, everything is done automatically, your windows getting smaller each time you open a new one. Of-course, you can change the positions and sizes, but only (mainly) with your keyboard.
Another luxury given up by deciding to use i3 is that of a start menu. Instead, you are required to use an alternate program launcher, in my case I'm currently using dmenu.
dmenu is a small application that allows me to start any program installed on my machine. By default, the hot-key to launch dmenu is mod+d (mod in my case is the Windows key), in which I kept. You are then prompted with a small bar at the top of your screen in which you type the program you want to launch, dmenu then looks at your installed programs and provides you with the appropriate options of which you select with your arrow keys.
Here is an example of what my second monitor currently looks like. Note the evenly set out windows, the lack of title bar buttons and the status bar at the bottom.
(Click image to enlarge it)

The installation of i3 and its recommended programs (such as dmenu) was easy, kind of.
to install i3 and dmenu I only had to run a simple apt-get command, they installed like a charm. and it was great.
I opted to not use the default status bar program that i3 comes with, named i3status, instead choosing to install i3blocks, which was a different story when it came to installing.
To keep it short, I had to download and compile the source code of i3blocks and do some magic hackery to get it to actually work, but we will talk about that later.
And so, once the installation process was complete, came the fun (yet long) process of configuration.
I'm a hipster. I dislike things default, and oh my, does that sometimes cause pain, and this time was no different.
The first thing I had to configure was easy, when I first logged into an i3 session I was asked if I wanted to create a configuration file, which I did, and was then asked to select a key that would act as the 'mod' key (mentioned earlier). My two options were the super key (Windows keys, you plebs) and the alt key. This was an obvious choice for me, my alt key is already taken by irssi my IRC client, so I selected the super key.
And so there I was, initial set-up complete, I was greeted to i3, a beautiful grey blank screen! I had never been so excited to see grey in my life. This is Linux dammit, of course the screen is blank! The first thing you are supposed to do is press mod+enter, which opens a terminal window. And so I was ready to begin. I opened a second terminal for SSH'ing into my server and launching irssi - this is literally the first step to life. I then opened my browser to the i3 user guide and began doing awesome things. Using Nano (yes Nano, vi shall be learnt one day) I opened my i3 configuration file (~/.i3/config) and began customising.
I wont bore you with all the little hot-keys and changes I made to colors etc, instead I will post the most important lines.
These lines are literal life savers. i3 doesn't handle being directly out of the box too well.
These hot keys do multiple things that are critical to me:
- control volume
- control my media player (I use VLC)
- lock my computer
Yes boys and girls, yes! There is no default way to lock your computer using i3!

 

# Pulse Audio controls

bindsym XF86AudioRaiseVolume exec amixer set Master 5%+ $

bindsym XF86AudioLowerVolume exec amixer set Master 5%- $

bindsym XF86AudioMute exec --no-startup-id pactl set-sin$



# Media player controls

bindsym XF86AudioPlay exec playerctl play

bindsym XF86AudioPause exec playerctl pause

bindsym XF86AudioNext exec playerctl next

bindsym XF86AudioPrev exec playerctl previous

#lock screen

bindsym $mod+l exec ~/lock.sh

By the way, lock.sh uses a program called i3lock, which is an optional i3 package, it simply locks my computer, privacy is key.
Configuring i3 was easy, as well as i3blocks. Again, I wont bore you with details.
Here is a video I watched and borrowed some tips from.
https://www.youtube.com/watch?v=ARKIwOlazKI
I'm currently three days into using i3 and to put it simply, I'm loving it. I expected a learning curve far beyond what I was welcomed with, instead really, all I needed to learn was a few hot-keys and short-cuts.
I'm still tweaking things here and there, slowly improving my experience, learning new things and just having fun.
If you're interested in using i3 and need some help, ask me or the guys over at the subreddit.
Here's to more future posts about i3 and elitism.


A terrible function - or why I suck at programming.

18/1/2016

Now, I don't claim to be good at programming, in fact I know I'm not. I have been self-taught, there was no such thing as a programming class or course at my school or surrounding area, which sucked.
But today something different happened.
Today I found myself writing a function for my RGB controller project. I had decided to add a 'presets' feature to my project, allowing one to create RGB values they enjoy and save them to file for later use. This idea was great, so I began.
Twenty or so minutes later I was done. Done, yet highly disappointed.
Here is my controller now with the presets feature added. It is pretty useful.

However, the point of this post is not to display new features, instead it is to come out about the shame I feel for have written a particular function that is ugly, dangerous and messy.
The function in question is displayed below and is one that is used to read the presets file that contain information to be displayed in the application.

 

void MainWindow::readPresets() // read presets from file and display them

{

    DebugLog("Reading presets from file");

    // read file if it exists, display on screen

    QFile file("/home/daniel_j/presets.cfg"); // change at some point!

    if (file.exists()) {

        file.open(QIODevice::ReadOnly | QIODevice::Text);

        QTextStream in(&file);

        while(!in.atEnd())

        {

            QString line = in.readLine();

            QStringList presetName;

            if (line.contains(":"))

            {

                presetName = line.split(":");

                ui->presetList->addItem(presetName[0] + "-" + presetName[1]);

            } else {

                DebugLog("Error parsing line: " + line);

            }

        }

    } else {

        DebugLog("Presets file does not exist");

    }

}

There are many issues, both dangerous and cosmetic in this function that I'd like to point out.
The first, and most dangerous is my use of line.split() and line.contains().
To put it simply, at the time I was facing "index out of range" errors when attempting to split the line retrieved from the presets file. So, the solution, I thought was simple. Check that the line contains the character I use as the character I will split later in the function, and it works. Great! But no, not at all. Later in this function I use the split function to split the line into two and store it in a 'QStringList'. Once again, it all looks like it is going to work, and it does.The issue arises later in a function that sends the RGB value to my Arduino, at this point, the program would crash and close fatally. The issue is only occurs when a user manually edits the presets file and finishes the line with the character I use to split, ':'.
The solution that I need to, and will implement is proper line checking, instead of simple contains() checks.
The final issue I will touch upon (this post is already too long) is that of my use of QFile, specifically the file location I use.
The line in question is 'QFile file("/home/daniel_j/presets.cfg"); // change at some point!'.
Ahem, let me clear my throat, NEVER HARD CODE FILE PATHS THAT ARE NOT UNIVERSAL.


The end of an era and the beginning of a new horizion

14/1/2016


The end one of my most loved services has come.
The image uploaded service I once ran has now been taken offline.
Now, now - don't cry, this was inevitable. Nobody except myself ever really used it anyway, and due to some recent happenings, bigger and better things are coming.
The biggest of which is lending my services to the creator of the game 'War World Infinity'. I won't say much about the game or creator except that you can follow their progress via their official Twitter account https://twitter.com/WarWorldInf
The game revolves around an interesting concept and I can't wait for it to become a working reality.
I am also now hosting a TeamSpeak server for a fellow CS:GO player, you can contact him via his Steam account (http://steamcommunity.com/id/Creeper_Corp500) or via TeamSpeak at danieljon.es.
If you're interested in getting a TeamSpeak server hosted for yourself, just ask! I'll be glad to provide you with one; providing I know who you are of course.
The third project is a potential upcoming project that revolves around the service that has retired today, keep up-to date here to find out more ;)
Don't worry, I will for sure keep on posting here weekly, unless I don't, in which case I don't.


My online identity and why being a nice guy screws you over

11/1/2016

Unlike many of you (or at least I presume) I've been known online by many 'handles' used to hide my real identity. No, I'm not referring to Mr. Anonymous on 4chan, instead a unique name that people can identify you with online. Lately however I've thrown the idea of anonymity out of the window and instead have been using the name 'daniel_j'.
You may or may not know me in real life, (if you do, sorry) but I tend to personally stick to a simple rule: Be as nice as I can possibly be and give anything I can to make others happy. Some may view this as 'buying' respect from people; well it is, that is true. What more can be said? Respect isn't something that comes free, it always has a price. Whether the price is weeks, months and years of time speaking and chatting with certain people online, getting to know each other greatly, or simply providing a service hosted on your own hardware/servers, it isn't cheap and it can heavily affect ones attitude towards you as a person - either positive or negative.
An inherit flaw to my master plan of utter bliss is that sometimes I just can't provide what is needed to either gain or prolong the respect once had and treasured. I don't like that - I can't handle the idea of not being able to provide something to you.
But that is crazy. Who are you to ask for something from me when I'm already providing you with something that is costing me. But, then again why am I happily providing you with a service. I met you randomly and felt bad due to your current service situation. Why am I not just putting you on my blacklist of people and carrying on. Why am I even typing this out, is it because I can't confront you again? Don't worry, I'm not removing your service, I enjoy it actually.
I'm a nice guy right, someone will one day show such niceness to me, right?
The solution isn't being an asshole, right?
If you're reading this - and you know who you are, I don't hate you, and I'm certainly not ignoring you, I just can't say no.


IRC Bot made in both Python and Java

7/1/2016

I help maintain and moderate (when it was relevant, now we just have fun) an IRC channel dedicated to user support for the game BeamNG.drive (www.beamng.com) located on the IRC server irc.beamng.com #BeamNG. If you have ever done any form of tech-support you know that the questions you receive are repetitive, very repetitive, and I for one, could only repeat myself so many times before I just had to come up with something easier.
An IRC bot was a great idea - there are literally thousands online and opensource - the most favourable being EggDrop. I however have integrity and cannot simply use such a thing to make my life easier. Instead, I opted to make one, well multiple, for myself.
Both of my final copies can be found here: https://github.com/daniel-Jones/BeamBot
One is programmed in Python, while the other in Java.
Both bots work in the same simple manner:

  • Bot is started via a console
  • It creates a socket connection to the IRC server, it then joins your selected channel and idles
  • The bot runs enters a loop that both checks for messages, logs the channel, checks for certain key word commands and replies to PING/PONG
  • When the bot finds a line that begins with '?' a file full of commands is opened and parsed one by one to find valid commands and provide a channel response

  • The bots are pretty simple, but has saved myself and others plenty of time.
    My IRC nick is daniel_j I can be found at the following locations, why not say hi:
  • irc.danieljon.es #fun
  • irc.beamng.com #beamng, #offtopic, #speedsims

  • Analysing and explaining my source code.

    26/12/2015

    Let's face it, my blog is stale - rarely new content, and whenever there is new content it is often short and boring.
    I've decided to try something different, I'm going to being walking you through snippets of my code, explaining what I'm doing and my though process, just for fun.
    I'm going to start today with my latest mini project, the number storage program.
    The first section of my value recording program is simple.
    I first include some C standard libraries that I need:
    stdio.h - used for standard IO such as printf etc
    string.h - used for comparing strings
    time.h - pretty simple, I use this library to determine the systems time
    I then proceed to define two functions that I use later on, this is to ensure that the C compiler knows the functions exists - compilers are dumb.

     
    
    /* database like program to record values */
    
    #include stdio.h
    
    #include string.h
    
    #include time.h
    
    
    
    /* functions */
    
    void addRecord(char* value);
    
    void readRecord();
    
    

    Next up, just like every other C program in existence I define a main function and add code inside of it. The main function in any program is the first place any compiler looks for code - without the presence of this function your program WILL NOT compile.
    To attempt to keep things slightly less complicated I shall post the source first and then explain it.
    [c] int main(int argc, char* argv[]) { if (argc < 2) { printf("Utility for recording and monitoring values\n"); printf("This utility requires arguments.\nusage: %s -l [list records] -i [insert record]\n", argv[0]); return 0; } int i; for (i = 1; i < argc; i++) { if (strcmp("-l", argv[i]) == 0) { readRecord(); break; } if (strcmp("-i", argv[i]) == 0) { addRecord(argv[i+1]); break; } } return 0; }
    Now, this is about the time those of whom don't know at least a little programming should leave - I'm not here to teach you how to program, just to explain what I do!
    I define the main function as an int - as you should know this is due to passing the OS an exit code upon completion. I also use the common "int argc, char* argv" to obtain CLI arguments as this is, of course a CLI only program.
    I follow the definition by checking for arguments, if this program does not receive at least one argument I print to the screen usage instruction and end the program.
    Once it has been confirmed that at least one argument has been passed I check them incrementally for specific key triggers - -l and -i. If none of these are found, the program ends silently - I could have told the user they didn't input a correct argument, but why bother.
    If the correct arguments are found, I call the relating function (the same ones we defined earlier) and let them take over - after passing the correct values of course, which in -i's case is anything AFTER the -i (-i was to INSERT, -l was to LIST).
    Once the functions are complete, we break out of the for loop and end the program - our job is done.
    The final parts to be explained are the two functions we use.
     
    
    void addRecord(char* value)
    
    {
    
    	printf("Adding record: %s\n", value);
    
    	/* before we open our file, we want to get our date and time setup which we will also write */
    
    	time_t rawtime;
    
    	struct tm *timeinfo;
    
    	time(&rawtime);
    
    	timeinfo = localtime(&rawtime);
    
    	/* open file for writing */
    
    	FILE *fp;
    
    	fp = fopen("values", "a"); /* a to append, not w - would overwrite */
    
    	if (fp == NULL)
    
    	{
    
    		printf("Can't open the file for writing.");
    
    	}
    
    	else /* file open, write data */
    
    	{
    
    		fprintf(fp, "%s - %s\n", asctime(timeinfo), value);
    
    		fclose(fp);
    
    	}
    
    }
    
    

    Oh my, if you are new to programming close your eyes and run, this looks scary.
    This function labelled "addRecord" does just that, it adds a record to the file we are using to store our data.
    Now, I have to be honest, this is a simple ass way of storing values. I use no database, I just take whatever a user enters and append it to the end of a file - lazy, yes, but very convenient as I don't expect anyone to actually use this script, except myself.
    I begin by informing the user of what record is being appended to the file. I follow it by some nice copy-pasta code for retrieving and converting the time and date to a human readable format that will also be appended to file.
    At this point we are ready to append our data to file, so I generically create a FILE pointer and fopen the file we are using to store data. I open it with 'a' access to allow the data to be appended - using 'w' for write mode WILL OVERWRITE the file, we don't want this.
    I then check to see if the file was opened successfully, if not I inform the user and the function ends there. If it was however opened correctly, I fprintf the data into the file we opened and then, of course then close it. The function then ends. Also note how I never delete the fp pointer, sue me.
    The next function is awfully similar and just reads and displays the entire file to the screen.
     
    
    void readRecord()
    
    {
    
    	/* open file for reading */
    
            FILE *fp;
    
            fp = fopen("values", "r");
    
            if (fp == NULL)
    
            {
    
                    printf("Can't open the file for reading.\n");
    
            }
    
            else /* file open, read data */
    
            {
    
    		char buff[1000];
    
    		while (fgets(buff, 1000, fp) != NULL)
    
            		printf("%s", buff);
    
                    fclose(fp);
    
            }
    
    
    
    }
    
    

    I use fgets to retrieve the files data into a buffer and then print it, etc
    Awfully simple, yet quite nifty and useful.
    Should I bother doing more of these? Probably not.


    simple C CLI program for adding and monitoring values

    21/12/2015

    I had a personal reason for needing to insert, store and monitor specific values - I could have just used a text document or piece of paper - but that is boring, who likes boring?
    The program in action is displayed below.

    The program allows only 2 arguments: -l (lists the values stored) and -i (insert values), everything else is ignored.
    To compile and run the program simply enter in any Linux programming environment: gcc main.c -o valueStorage;./valueStorage
    The program will compile and present you with an output describing your options.
    The source code is located here for anyone to use: http://pastebin.com/027YH4Qi
    As always, you can contact me via my email: admin@danieljon.es or via irc: danieljon.es:9090/?channels=#fun
    (if you try to use the IRC server use a realistic name that identifies yourself, if not you will be kicked from #fun)


    Been on Windows playing Fallout 4 - ashamed.

    1/12/2015

    But, i'm now back home doing what I love.
    A new theme face lift, fancy background images and home security camera setup. Perfect.
    Current work space - split over 2 1920*1080 monitors.

    I'm currently working on my RGB lighting program - more precisely, I'm working on the micro-controller side of things - fun!
    So much for """"daily"""" posts.
    You can always find me on my IRC server - http://danieljon.es:9090/?channels=#fun - I kick anyone that doesn't identify themselves.
    Or, contact me via Email at: admin@danieljon.es


    Game engines and OpenGL

    6/10/2015

    Lately I've been teaching myself OpenGL in C using GLUT, literally as low level and annoying as you can get.
    Just today I've been playing with an engine known as 'Irrlicht'. It is an OpenGL C++ API for OpenGL.
    At the moment i'm just simply loading meshes and maps from Quake, I hope soon to get a shooting game of sorts going, but that is quite a while away.
    You can download a video of my current progress here


    Langton's Ant

    20/9/2015

    Inspired by https://www.youtube.com/watch?v=NWBToaXK5T0 I've decided to embark on creating my own version of this simulation using Qt/C++.
    Yet another boring weekend.

    Woo, I have a grid drawn, amazing.
    2d graphics suck.


    Card hand generator

    17/8/2015

    When not flicking them i'm randomly generating them, because why not.
    It is written in C and is able to be compiled on any UNIX/Windows environment.
    example use:
    ./CardsGrid hand 5
    this generates a completely random hand of 5 cards. (seeded with the current time)
    the code for this mini-project can be found here http://pastebin.com/1KyJBEB6
    .


    Front panel PC device

    12/6/2015

    Recently I've been working on a front PC panel device.
    Seeing as there are plenty of unused slots I've designed and created a display panel containing a 16*2 LCD display and a small OLED screen.
    They are powered by an Arduino with the data coming from an application made in C++/Qt communicating via a serial connection via USB. Currently it can play a few songs through a piezo buzzer, and just for fun, I created a simple flappy birds clone.
    The arduino has an internal controller made up of 3 buttons; however for external interaction I have added an infra-red reciever; this allows me to control the entire project with an IR controller - I have chosen and programmed my RGB LED controller -any controller can easily be added.
    The arduino is currently sitting inside my PC and the mounting for the screens are ugly. But it isn't done; I plan to make it look better and add features such as CPU/RAM etc monitoring with graphs and a weather display.
    Here is an image of the current application controlling the Arduino:

    And here is a horrible image of the display (shitty webcam):

    I'll repost any updates made.
    update:
    Have done some major work to the UIs back end.
    It downloads a weeks worth of data for your location and stores it all etc.
    Also allowed the user to display custom text on either screen, makes your computer look more personal.

    I've now published the code on GitHub and will update it regularly.
    https://github.com/daniel-Jones/PC-Panel-Display


    Services I run

    5/6/2015

    I've realised that I run quite a few things on my server, some useful, most not:
    IRC (Internet Relay Chat) Server:
    I run this server for myself and a few people to hang out in a free setting - http://irc.danieljon.es:6667
    QWEBIRC - Online IRC Client (connects to my server):
    I run this service to allow people without IRC client to connect to my server (derp* sucks) - http://danieljon.es:9090/
    ZNC - IRC Bouncer:
    This is a private bouncer using the ZNC software package, this allow myself and a few others to connect to multiple IRC servers using a fancy reverse DNS host (currently relaxing.in.the.stars.because-of.science)
    IRSSI - IRC client:
    IRSSI is a text based IRC client I run on my server inside a screen session.
    Image Hosting Service:
    I created an image hosting service from scratch because I figured it would be useful for assisting people with issues in #BeamNG, it turned out to just be a cool project for myself and others to use - http://upload.awful.pictures
    Custom User Software:
    I've also integrated the image hosting service with a register/login system custom made using PHP and MySQL, this allows you to register to services (I currently have a "Draw something" game made and a file uploading service) that are not available to the public. The database has critical information MD5 hashed with a custom salt accompanying it - your password is completely safe. - http://danieljon.es/login/
    Blog:
    You're here right now; I point all my domains here - http://danieljon.es
    Domains:
    I currently own and maintain one server with 3 domains:
    danieljon.es - main domain used for most things - if you didn't notice it is my name, Daniel Jones - I bet you don't have your name as a domain
    awful.pictures - I use this domain for my image hosting service
    because-of.science - my server has a reverse DNS record that points here - it makes me look sup3r l33t in IRC.
    Email server:
    I currently have an email server setup - instead of using Gmail and having a something@gmail.com address I have something@danieljon.es - My main account admin@danieljon.es - this is where you can easily reach me (or IRC of course)
    I will probably host a lot more in the future, but currently, this is all I need.


    Simple server in C++/Qt

    5/6/2015

    I've been using sockets lately for serial communication between C++/Qt and my arduino. I figured I may as well try out a TCP server using sockets. It's quick and dirty, but pretty cool and holds many possibilities for projects. I connect via telnet in a running bash terminal - it doesn't actually do anything other than connect and communicate with each other.


    Phone SIM cards are easily exploitable and overly intrusive

    27/5/2015

    Phone SIM cards are easy to exploit and are overly intrusive

    The life of an individual in 2015 is vastly different to that of other decades in the fact that everyone is lazy in some way or form; whether it be for work related purposes, or easy access to your social media accounts we all have a mobile phone that contains a piece of technology that is easily exploitable (taking advantage of software/hardware bugs/issues) and overly intrusive. Within our mobile phones, whether it be a smart phone or not, we have all conveniently placed an extraordinarily powerful and smart device that can allow a hacker to take complete control of your phone, a SIM card. A SIM (subscriber identity module) card1 is a piece of technology that everybody knows exists, yet hardly anyone can define what it actually does or how it works, they just know you need one to get onto Facebook; believe it or not the humble SIM card in your phone is a fully fledged computer and can host and run applications without your phone, thus yourself ever knowing. The alarming facts do not however end there; your phone, whether it be a 2005 flip phone, or the latest product from Apple with finger print identification to stop hackers allows your telecommunication providers, or in the worrying case, a hacker to run applications on your SIM card potentially allowing them to spy on your GSM2 traffic which includes your phone calls, SMS messages and Internet usage.

    An eye opening speech3 by Karl Koscher and Eric Butler performed at Defcon 214 (an American based hacking conference) displayed, for the first time, the power and pure horror of what a SIM card is intentionally capable of doing when in the hands of a hacker. A single generic SIM card has the power similar to that of a basic Arduino5, with an alarmingly larger range of nefarious uses. These pieces of hardware contain an 8-bit AVR (micro controller, similar to a computers central processing unit), 256KB of ROM (program memory), 72KB of non-volatile (doesn't require power to store any data) EEPROM (flash based storage, this is where the SIM cards programming is stored), 6KB of RAM and operate at 20-30 MHz. These specifications, to anyone that has knowledge around computers and hardware are, to put it simply, astonishing; the possibilities of these devices are endless, and I can not exactly fathom how and why they have not yet been exploited on a large scale - as far as we know. As explained by Karl and Eric to modify and flash (upload your own code) a SIM card you need physical access to your victims card, along with some easily obtainable hardware to communicate with the card. However the flash based storage on most newer SIM cards can not be modified - so how can these devices be hacked in present day 2015? They explained that you must start from the beginning. Karl and Eric purchased blank SIM cards and flashed their own code onto them and gave them out to willing citizens who amazingly accepted free SIM cards, this was of-course a proof of concept operation and any recorded data was destroyed.

    Unknown to many a programming language known as Java6 is found within most everyday pieces of hardware we take advantage of, especially those that have one main function such as a DVD player or the computer that controls the ice in a modern day refrigerator. A SIM card is no exception; these pieces of hardware run a variation of Java known as 'Java Card7'. This programming language creates applets (the final compiled version of your code) that leave a small memory footprint; perfect for the specifications of a SIM card. Oracle, the current owners of this software have released a free SDK8 (software development kit) to those of whom are interested in developing applets - this in theory is great for those of whom are interested in the technology and do not have the funds to purchase licences; it however allows malicious hackers to develop their own firmware for SIM cards that are intended to be distributed for free. SIM cards are given permission by the end users mobile phone to run applications both on the SIM card and devices background without the consent of the owner - this however is not an exploit or mistake; this is how GSM phones are designed and you are expected to have a legitimate SIM card. Early mobile phones are considered 'non-smart', this means only one thread/process can be run at any given time - think back to playing Snake on an old Samsung dot matrix phone, you are about to beat your personal high score when somebody calls you; your game is closed and score is lost. Due to a phone then being only single threaded your SIM card was important for processing incoming data such as phone calls and SMS messages, which would then alert your phone - this required a high level of permission and trust; sadly the technology and single-threaded 'mind-set' is still around today, even in modern day 'smart phones'. Try it for yourself; if you own an iPhone locate the menu item: settings->phone->SIM applications, if you are using an Android phone head to your application list and select the item "SIM toolkit" - these are applications that are currently installed on your SIM card and are running without your knowledge or permission. Having a malicious SIM card inserted into your phone will allow a hacker to run their own applets and intercept any incoming GSM data. Once you have an exploited card there is nothing that can be done with the exception of getting a new card - do not accept SIM cards from anyone unless they are behind a cash register and chewing gum; but you can not really trust them either.

    The story of the exploitable SIM card will however not come to an end any time soon; they are simply too convenient to swap and replace and work exceptionally. Even with the chillingly confronting information provided, you as the audience will not cease to use the seemingly humble SIM card and ironically I myself will not either: we are the problem and the solution, we must want things to change before they actually will. However lets be honest, who actually cares about the alarming state of SIM card hacking, our service providers do not as the technology has not changed since the mid 1990's, you probably wont tonight or tomorrow either - by the way, I have a few spare SIM cards with free unlimited data plans, would you like one?

    1http://www.imore.com/what-is-sim-card

    2http://studenttravel.about.com/od/globalcommunication/a/stayconnected_3.htm

    3https://www.youtube.com/watch?v=31D94QOo2gY

    4https://www.defcon.org/

    5http://en.wikipedia.org/wiki/Arduino

    6http://java.com/en/


    CS:GO cross hair generator

    25/5/2015

    Recently I've been playing a lot of the game Counter Strike:GO.
    This is a game that requires precise aim; and with aim comes a cross hair.
    I was influenced by an on-line CS:GO cross hair generator (http://tools.dathost.net/) and decided to create my own.
    I've got the basics sorted, I just need to work on the rendering of the on screen preview.
    I'm using the Qt framework and C++ for this project.

    I hope to actually follow through with this project and complete it.
    Stay tuned!
    Update:
    Only a few hours later and it's complete!


    Finally moved to GNU/Linux and am loving it.

    22/5/2015

    I made the decision to finally move to GNU/Linux a few months ago; and I haven't regretted it once.
    I'm using Linux Mint 17.1 with KDE.
    This is a current capture of my main monitor (I currently run dual 1920*180 monitors). It'll be interesting to see what it looks like in a year and if I'm still using GNU/Linux.


    Nearly a year has passed; it's time to try this again.

    22/5/2015

    It has been a whole year, a lot has happened, some I want you to know, some I certainly do not. The main thing that has occurred was a mistake I knew I'd regret; walking out of high school.
    It just was not for me. There was nothing there that interested me, there were no classes relating to my aspiring career, there was no one I cared about. Just because I'd talk to you did not mean I liked you as a person nor considered you a friend. I didn't give a single shit about what you nor anyone had to say.
    And now I'm doing something called 'FLC'.
    This should really be called 'school for the troubled' because that is what it is. The students there have problems, socially and mentally and I, a perfectly capable student am being forced to do it. I am only doing it for the benefit of others; nothing will come from it other than a piece of paper saying I spent 12 years in school.
    But I digress:
    I've come to realise that the field of which I want to spend my professional life in is changing. Having an on line identity is important. This does not necessarily mean Facebook and Twitter; instead I'm making it this blog.
    I plan to add posts here every day or two in hopes utilising it one day as a reference to my dedication to the field. I may talk about things that I feel strongly about, programming or just general rant subjects, like it or not my voice needs to be heard; even if it is just myself in a few years.
    Here's to another shitty year.


    Critical review of a Social App - Imgur

    21/9/2014


    Imgur (pronounced imager) is a website that allows people to share images as a community and comment/vote on pictures that interest them. This website is also the origin of many, many online 'memes' that seem to be 'the craze' of teenagers in 2014.
    "Whoa, hold on a second; this isn't a website where one can share what they ate for lunch, how is this a social media application?"
    This particular web hosting service holds a user base of which is undeniably strong; over 100 million unique users. That being said, why would one actually use this service? This service provides the internet with many funny pictures, is another a purposes needed? Of-course it is, and one purpose is convenience. Have you ever been in a conversation online and wanted to share a picture with the person you are chatting to? Sure, you could use the file transfer feature found in many IM clients, that however requires you to have decent upload speeds, which not many have unfortunately (thanks NBN). Do not fret! Imgur is here to help you, simply upload an image and paste the URL into the chat, simple! However, this isn't exactly where the 'social' bit comes into play; the area it is used in the comment section of images. Similar to how Facebook allows one to insert comments about the supposed 'selfie' one posts online, Imgur allows you to comment on images allowing you to voice your opinion on the subject, or to simply splutter out 'AYY LMAO', whichever you fancy.
    Getting onto a more serious note, Imgur as a web service doesn't exactly help one to connect with others in a professional sense, it does however allow people to congregate around subjects and topics that people may find interesting, thus I personally view this application as one that you may use as a form of entertainment instead of one used to promote yourself online.
    The area of image sharing is 'big business' on the internet in the years prior to and including 2014; everyone seems to want to provide this type of service (heck, I've even created an image hosting service http://upload.awful.pictures) however only Imgur, in my opinion has done it successfully.
    The process of creating an account on this particular application is quite painless; you simply provide a username, email and a password, then you are sneakily confronted with a captcha to solve, which is quite normal this day and age. You then activate your account via an email received; then, at this point you can begin uploading!
    Avoiding the obvious joke one could make regarding the question revolving around the security of this particular application (" How much personal information do you need to volunteer to sue the App?" - this gave me a much needed laugh, would I have passed the course if I successfully sued Imgur for millions of dollars?), I personally find it to be literally as safe as it gets online anymore. Unlike other services you don't need to provide your real name, location, age etc, you just provide the basics Of-course requesting an email address a few years back would have been regarded a little much, however in the age of today, the age of spam; this is a much needed security feature.
    Imgur is an interesting platform used by many people who frequent forums and instant messaging chat rooms as an easy way to share images, and has quite a significant place in the heart of myself and others alike. I personally hope services such as Imgur become more mainstream and develop further, allowing users to create and different features of which have not been thought of at this particular time.
    References:
    http://www.en.wikipedia.org/wiki/Imgur
    http://www.imgur.com
    http://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Imgur_logo.svg/800px-Imgur_logo.svg.png


    My perception of Social Networking

    21/9/2014

    First of all, let's get the reason for not selecting the Mahara/LinkedIn assessment out of the way. I personally dislike social networking websites as a whole; I see it as a way for those too lazy to experience new things to communicate with each other. I am a personal fan of IRC (internet relay chat), an instant protocol designed to allow a group of people to chat simultaneously, instead of the alternative of posting a useless picture of yourself on Facebook and waiting an hour for someone to post some ridiculous comment. With saying that, via social networking one may acquire a positive presence on the blah blah blah. let's just begin.
    Personal experiences
    As you may have noticed via the introductory text above, my personal view on social media applications is quite poor; however my experiences are not negative. For the purposes of this text, lets stick to one social media application everyone knows; Facebook. Over the years I have personally made multiple Facebook accounts in the hopes of actually 'getting into it', yet, each and every time I just can't. The origins for creating these accounts was always the same; peer pressure. An apparent unwritten social rule of 2014 seemingly exists that states: "Thou shall only communicate through Facebook", which to someone who dislikes the idea, quite unfortunate. This has led me to have little to no communication with friends outside of school; which I have no issue with personally, however my peers dislike it. As for social mediums I enjoy and participate in often; only one exists, IRC (heck, I even run my own IRC server). Internet relay chat is an internet protocol designed in 1988 by a man known as Jarkko Oikarinen [1]. I could write thousands of words on this particular topic, however I am not going to; that might be another assessment one day.
    How would one stay safe and secure online?
    Keeping safe and secure is an important thing when accessing the internet; and will only grow in importance as we move on with our technological revolution.
    With that being said, the steps required to keep ones information private and secure online could be etched into ones brain; most people still will not get the message. I feel that most people have the ideation that the biggest thing to keep safe and secure online is their passwords. Sure, keeping your password secure is important (keep it long, alphanumerical and not relating to personal names or dates), however other factors need to be considered and kept private online. One example of which is usually forgotten is that of your email address. A persons email address in 2014 is (hopefully) sacred, and should only be shared with those of whom you know and trust. Another key thing that should be protected is the access keys to ones bank accounts; especially considering the use of physical money is dropping, and the use of online banking is rising. A simple solution to keeping passwords and access keys etc secure is good anti-virus and spyware on ones computer; however, you must also be aware of phishing. Phishing is the act of creating false websites (for example a bank log in page) that are designed purely to record the numbers and passwords entered into an input field [2].
    Promoting ones self online
    Social media is an interesting new concept that is starting to be acknowledged by the professional community as a way to decipher the maturity of one and to help decide whether or not that person is worthy of being hired into a place of business. Almost everyone in today's society has a presence online (whether good or not) and that presence will one day either promote themselves as a valuable member of society; or demote them, which is likely to cause a negative ripple within their professional life. I myself have personally chosen to not participate in the anarchy of social media; I feel it (as previously stated) is the lazy mans way of getting noticed, I prefer to design my own ways of promotion; for example owning a domain with my name, a perfect place to, in the future hold my digital resume (which, in the future will be how resumes are distributed). With that being said promoting myself on a website such as Facebook would add additional promotional content, however I feel this to be unnecessary.
    This, however is completely different for that of a business. Businesses in my point of view need a form of social media to keep in contact with their customers; their community, a way to promote deals and sales, and a way to pass critical information on. Personally, a business should own both a website and multiple social media accounts, just to be sure their user base is as large as it could be (for example, I wouldn't 'follow' 'Server Sellers Inc.' (made up business) on their Twitter account, I would however follow their website.
    What is an 'RSS Feed'?
    A portal for lazy people. RSS (rich Site Summary) feeds allow one to easily view recently published information from, for example a blog, or news website. These are presented in XML format and is parsed by an XML reader into human viewable content; perfect for lazy people, you don't even have to open your browser (assuming you have an RSS reader setup)! Boring yes, useful, well, kind of [3].
    I've personally used RSS feeds before; specifically for a website i'm currently designing for a family friend (football club fan site; pulls an RSS feed from the clubs website), and personally, I find the idea to be over rated, what is wrong with just getting an email?

    References
    [1] http://en.wikipedia.org/wiki/Internet_Relay_Chat
    [2] http://www.consumer.ftc.gov/articles/0272-how-keep-your-personal-information-secure
    [3] http://en.wikipedia.org/wiki/RSS



    daniel@main~$ |