danieljon.es

index posts opinions likes dislikes interesting cgit

Posts

My posts about programming and things.
Date format is DD/(M)M/YYYY because I'm sane.

prev 1 2 3 4 5 6 7 8 9 next
direct link

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.

post37_1

direct link

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

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.

post36_1

direct link

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.
post35_1


direct link

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.


direct link

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.
post33_1


direct link

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 media/posts about it
                will it be on YouTube?
                        - no, it will be an mp4 file located on the USB drive submitted
  

direct link

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.


direct link

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.


direct link

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.


direct link

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 media/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 media/posts and transfering them between servers.

Displaying the media/posts on my blog page

The system I use for displaying my blog media/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 'media/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 media/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("*.php", GLOB_BRACE));
for ($total; $total >= 1; $total--)
{
	include('' . $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: media/posts, which contains all of my blog media/posts and a single subdirectory named media, which, you guessed it, contains the media used inside my blog media/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.
post28_1

prev 1 2 3 4 5 6 7 8 9 next

page generated 2018-11-20 20:26:21 using sitegenerator