From 9d2cbb865799faa9ef0ee49475f5b86b4a7136f0 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 4 Feb 2017 21:42:45 +0000 Subject: [PATCH] Update projects content --- content/projects/astrill-extractor.md | 7 ++-- content/projects/attack-on-blocks.md | 8 ++--- content/projects/bsod-enabler.md | 8 +++-- content/projects/dotfiles.md | 17 ++++++---- content/projects/hipchat-emoticons-for-all.md | 16 --------- content/projects/morse-code-decoder.md | 9 +++-- content/projects/wiki-game-solver.md | 34 +++++++++++-------- content/projects/yoga-pal.md | 25 ++++++++++++-- 8 files changed, 68 insertions(+), 56 deletions(-) delete mode 100644 content/projects/hipchat-emoticons-for-all.md diff --git a/content/projects/astrill-extractor.md b/content/projects/astrill-extractor.md index cc0222b..9b5911e 100644 --- a/content/projects/astrill-extractor.md +++ b/content/projects/astrill-extractor.md @@ -5,14 +5,13 @@ slug: astrill-extractor repo: https://gist.github.com/RealOrangeOne/050da86871fb952ba7bfe97eece8555c --- -Astrill, my VPN of choice, allows you to export OpenVPN config files for all it's VPNs, allowing you to connect on platforms it doesn't provide clients for. The AUR package `astrill` has started becoming really unstable on my machine, so I decided to switch it out for these VPN files, as gnome has excellent support for OpenVPN. - -The export step is really simple, you just login to the web portal, create an entry for your machine, and export the config files. Their tutorial for this can be found [here](http://wiki.astrill.com/index.php/Astrill_Setup_Manual:How_to_configure_OpenVPN_with_Network_Manager_on_Linux). The problem with this is that some applications wont accept the certificates embedded into the file like this. (Gnome does, but I only realised that whilst writing this). So I started writing a simple parser to extract the certificates from the config files, and saving them as separate files. +Astrill, my VPN of choice, allows you to export OpenVPN config files for all it's VPNs, allowing you to connect on platforms it doesn't provide clients for, which albeit isn't many. The AUR package `astrill` has started becoming really unstable on my machine recently, so I decided to switch it out for `ovpn` files, as gnome has excellent support for OpenVPN. +The export step is really simple, you just login to the web portal, create an entry for your machine, and export the config files. Their tutorial for this can be found [here](http://wiki.astrill.com/index.php/Astrill_Setup_Manual:How_to_configure_OpenVPN_with_Network_Manager_on_Linux). The only problem is that some applications won't accept the certificates embedded into the file like astrill provide. (Gnome does, but I only realised that whilst writing this). The above script will split out the files and save them into separate directories for each config file. These files can then be imported and used in an openvpn-compatable application. ### Is it even needed? -Certain network-manager packages actually supports importing `.ovpn` files directly, and sets everything up for you, including the files for the keys etc, without needing to extract them before. This does make my script useless to me, but hopefully someone will find it useful! +Certain network managers do support importing `.ovpn` files directly, and sets everything up for you, including the files for the keys etc, without needing to extract them before. Gnome's `network-manager` does this. This does make my script useless to me, but hopefully someone will find it useful! diff --git a/content/projects/attack-on-blocks.md b/content/projects/attack-on-blocks.md index 47ff138..fdb7c7c 100644 --- a/content/projects/attack-on-blocks.md +++ b/content/projects/attack-on-blocks.md @@ -6,11 +6,11 @@ repo: https://github.com/RealOrangeOne/attack-on-blocks/ download_link: https://github.com/RealOrangeOne/attack-on-blocks/archive/master.zip --- -Attack on Blocks is a space invaders style game that I wrote for my IT coursework, for the games development unit. We were allowed to make any game that we wanted, provided it could be done within the time limits, be very easy to play, and easily run on the college computer (which were pretty terrible). I had never written a game before, so I knew this was going to be a challenge. +Attack on Blocks is a space invaders style game I wrote for my IT coursework, for the games development unit. We could make any game we wanted, provided it could be done within the time limits, was very easy to play, and easily run on the college computers (which were pretty terrible). -I decided to write the game in Python, seeing as there were other people in the class that could help me bug report and test features, and because it was easy to run on the college computers. I used PyGame for the graphics library, even though I had never used it before, because it was really simple to use, and there was a lot of support and documentation online. +I decided to write the game in Python, seeing as there were other people in the college that could help me bug report and test features, and because it was already installed on the college computers. I used PyGame for the game engine, because it's really simple to use, and there is a lot of support and documentation online. ## Easter Eggs -One of the key features of this take on space invaders (and unfortunately the thing I spent the most time on), is the easter eggs. There are a few dotted around the game, which make the game either much easier, or way more fun! At the moment, there are 3 main easter eggs, the first enabling the other 2. If you would like to know what they are, click the button below. If not, pay the game and try and find them, or search through the source to find them (it's not too hard through the source). +One of the key features of this (and unfortunately the part I spent the most time on), is the easter eggs. There are a few dotted around the game, which make the game either much easier, or way more fun! At the moment, there are 3 main easter eggs, the first enabling the other 2. If you would like to know what they are, click the button below. If not, pay the game and try and find them, or search through the source to find them (it's not too hard through the source). -As you will see (If and when you find the easter eggs), most of them are completely useless, and completely unrelated to the game or anything else. The main reason they were put in was because I'm friends with people that pester to the point it's just easier to give in. Hence there are some really very odd ones! +As you will see (If and when you find the easter eggs), most of them are completely useless, and completely unrelated to the game or anything else. The main reason they were put in was because I'm friends with people that pester to the point it's just easier to give in, hence they are really rather odd! diff --git a/content/projects/bsod-enabler.md b/content/projects/bsod-enabler.md index fae40e3..2d19728 100644 --- a/content/projects/bsod-enabler.md +++ b/content/projects/bsod-enabler.md @@ -5,10 +5,12 @@ slug: bsod-enabler summary: Call a _Blue Screen of Death_ on demand! It's more fun than it sounds --- -For those that use Windows, the famous [Blue Screen of Death](https://en.wikipedia.org/wiki/Blue_Screen_of_Death) is an annoyance that plagues computers, causing error, frustration, and even data loss. They happened to me a lot whilst I was trying to configure my computer, and I thought _I wonder who else I can annoy with a BSOD_ +For those that use Windows, the famous [Blue Screen of Death](https://en.wikipedia.org/wiki/Blue_Screen_of_Death) is an annoyance that plagues computers, causing error, frustration, and even data loss. They happened to me a lot whilst I was trying to configure my computer, and I thought _I wonder who else I can annoy with one of these_... __And thus the BSOD_Enabler was born!__ -After researching into it for a while, it turns out that there are a few different ways to cause a BSOD, unfortunately most of which are by doing things that are meant to cause a BSOD, and can therefore be dangerous to a computer, something I didn't really want. Then I stumbled upon [this article](http://www.wikihow.com/Force-a-Blue-Screen-in-Windows), which shows that you can in fact raise a BSOD without causing any errors or damage to your computer. Now to write a program that can do it too! +After researching into it for a while, it turns out that there are a few different ways to cause a BSOD, unfortunately most of which are the reason a BSOD is there in the first place, which could potentially damage the target machine, something I didn't want! Then I stumbled upon [this article](http://www.wikihow.com/Force-a-Blue-Screen-in-Windows), which shows that you can in fact raise a BSOD without causing any errors or damage to your computer. -Obviously there are many different ways, and probably far better ways of doing this, but I wanted something that was simple to use, fast, and could be done by anyone, no matter how technically illiterate. So I decided to write it in C#, and use a windows console interface. +Obviously there are many different ways, and probably far better ways of doing this, but I wanted something that was simple to use, fast, and could be done by anyone, no matter how technically illiterate. I decided to write it in C#, and use a windows console interface so the whole thing could be done with a few key presses. + +Unfortunately I can't find the original source, or a copy of the executable. Once I find them, i'll update this post! diff --git a/content/projects/dotfiles.md b/content/projects/dotfiles.md index 000c1b5..868882c 100644 --- a/content/projects/dotfiles.md +++ b/content/projects/dotfiles.md @@ -7,14 +7,19 @@ summary: How I set up my machines just the way I like them! --- ### What are dotfiles? -Dotfiles are a way for people to store their settings and preferences to make setting up a new computer that much easier. They can usually be found in a persons VCS profile. +Dotfiles are a way for people to store settings and preferences to make setting up a new computer that much easier. I use both my laptop, desktop and work machine almost every day, and want them to be setup in an almost identical way. -### Taking dotfiles 1 step further -I use both my laptop and work machines almost every day, and want them to be setup in an almost identical way, despite the fact that 1 runs Ubuntu, and the other runs Arch. The main things I needed synced over were my `.bashrc` file and my atom config. +Most people I've seen store their dotfiles on GitHub. This is a great solution as it's possible to add authentication before accessing them, and stores a complete version history. This solution doesn't really work for me, having to run `git pull` is just too much effort to update files! ## How I did it -Originally, I used my owncloud server to sync all my dotfiles between my computer, and then used symlinks to split out the relevant files into the relevant locations. +I used my nextcloud server to sync all my dotfiles between my devices, and then used symlinks to split out some of the files into the right locations. This means that changes can be updated live between machines -This worked brilliantly, config files were automatically synced as soon as I made a change. This was especially great for my `.bashrc` file! The main problem was with atom packages, I had to manually store what files were installed, then manually install them on the other machine from the saved file. This was made easier by `apm` allowing me to list them and automatically save them in a file, but it wasn't perfect. +This worked brilliantly, config files were automatically synced as soon as I made a change, just as soon as they connected to a network. + +After I got this all setup, I started committing the files to my GitHub too, so they could be publicly accessibly. I had to use the `.gitignore` to stop some parts being public like SSH config, but the rest is completely open! + +### Atom +The main problem was with atom packages, I had to manually store what packages were installed, then manually install them on the other machine from the saved file. This was made easier by `apm` allowing me to list them and automatically save it to a file, but it wasn't perfect. + +Eventually, after looking into possible solutions, I came across the [`Sync settings`](https://atom.io/packages/sync-settings) package, which was the answer to my prayers! It saved all my config data for atom into [a gist](https://gist.github.com/RealOrangeOne/9f9a4dd799ad01aa0502a09f06cbf454/), which I could then backup and restore too from within the application. It also warned me when my local data was out of date from the remote, and prompt me to download the updated data. -Eventually, after looking into possible solutions, I came across the [`Sync settings`](https://atom.io/packages/sync-settings) package, which seemed to be the answer to my prayers! It saved all my config data for atom into a gist, which I could then backup and restore too from within the application. It also warned me when my local data was out of date from the remote, and prompt me to download the updated data. diff --git a/content/projects/hipchat-emoticons-for-all.md b/content/projects/hipchat-emoticons-for-all.md deleted file mode 100644 index 8be5f38..0000000 --- a/content/projects/hipchat-emoticons-for-all.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Hipchat emoticons for all -template: projects -slug: hipchat-emoticons-for-all -repo: https://github.com/RealOrangeOne/hipchat-emoticons-for-all/ ---- - -After starting my new job at DabApps, I was introduced to the world of [Hipchat](https://hipchat.com), and it's wonderful array of emoticons, as well as the ones added. It was wonderful, it made communicating with friends and colleagues much more interesting! - -Unfortunately, the emoticons on the other services we use, like [GitHub](https://github.com), were terrible in comparison. So it was after a discussion with [@JakeSidSmith](https://github.com/jakesidsmith) about him just using things like (facepalm), (notsureif), and (wat) in [Facebook messenger](https://www.messenger.com/) and hoping people understand what it means, that I decided to make 'Hipchat Emoticons for all', so people like him could use a much better set of emoticons. - -The premiss is very simple, whenever it sees a hipchat emoticon code, like (notsureif), it replaces it with an emoticon. If only writing the code could have been this simple! I started writing the plugin in firefox, using [Jetpack](https://wiki.mozilla.org/Jetpack), which uses Javascript. The initial stages of the code were very simple, but I encountered problems making sure that anything loaded after the page was loaded (such as a Facebook message), be changed too. - -Fortunately after many hours of testing, and changing the code, I finally got everything working perfectly, and in a way that made adding new sites incredibly easy! The code isn't the greatest in terms of performance, and there are some things that could have obviously been done better, but this was all done to help with a shared codebase between Chrome and Firefox, which don't play nice when it comes to extensions. - -Currently the application is in very beta stages right now, only having tested partial support for GitHub, but the code is all available on GitHub, if people have their own suggestions of improvements. diff --git a/content/projects/morse-code-decoder.md b/content/projects/morse-code-decoder.md index 7dd19d4..af9533e 100644 --- a/content/projects/morse-code-decoder.md +++ b/content/projects/morse-code-decoder.md @@ -6,15 +6,14 @@ repo: https://gist.github.com/RealOrangeOne/6dc94875c93b787e5834 summary: A JSON file to help decode morse-code --- -It's not often someone will need to decode text into morse code (and visa-versa), but if I had something like this when I needed it, it would have saved me hours of time! +It's not often people need to decode text into morse code (and visa-versa), but if I had something like this when I needed to, it would have saved me hours of time! -I originally wrote this code for the [Student Robotics 2015](/robotics/2015/) Entry, to convert a string message into a morse code message that would be transmitted using LEDs, for aesthetics and debugging. Unfortunately due to a fixed time frame, this idea was scraped before it could be fully implemented. Fortunately the decoder worked perfectly! +I originally needed this for the [Student Robotics 2015](/robotics/2015/) entry, to convert a string message into morse code that would be transmitted using LEDs, for aesthetics and debugging. Unfortunately due to a fixed time frame, this idea was scraped before it could be fully implemented. However, the decoder worked perfectly! ## Usage -In order to make it accessible for as many people in as many different languages as possible, the data is in JSON format. Just find a JSON library for your desired language, and it'll work perfectly! - -The source of the library is on GitHub as a gist. I recommend downloading the file to use yourself, however for testing you can use GitHub's raw view as a hotlink. +In order to make it accessible for as many people in as many different languages as possible, I converted our code from python to JSON. Just find a JSON library for your desired language, and it'll work perfectly! +The source of the library is on GitHub as a gist. I recommend downloading the file to use yourself, however for testing you can use GitHub's raw file as a hotlink. diff --git a/content/projects/wiki-game-solver.md b/content/projects/wiki-game-solver.md index ad2a6fd..b8b191c 100644 --- a/content/projects/wiki-game-solver.md +++ b/content/projects/wiki-game-solver.md @@ -6,27 +6,31 @@ repo: https://gist.github.com/RealOrangeOne/7da9a3dd1bf90ecdf7be summary: Simple script to win the Wiki Game --- -For those who don't know what the Wiki Game is: [The Wiki Game](http://thewikigame.com) is an online game where you attempt to navigate through wikipedia from a start page to a goal page using as few other pages as possible. Once I was shown the Wiki Game by my friend, and after I realised that I really wasn't very good at it, I looked into how the system worked, and how I could beat it. +[The Wiki Game](http://thewikigame.com) is an online game where you attempt to navigate through wikipedia from a start page to a goal page using as few other pages as possible. -I couldn't see how the back end worked, but after playing a few games and checking what happened on the page,the way that the game was won was when the iframe was at the final page location, or at least a clone of it on their servers with extra querystring information. +Not long after I was shown the it, I realised that I _really_ wasn't very good at it. After about 15 minutes of coming in last place all the time, I started to wonder how it worked, and how I could beat it. -With this information, I started to write some javascript that would change the location of the iframe to the goal. Fortunately for me, there was already a link to the real winning page, so I could use that to construct the final URL, and direct the iframe to it, meaning I was able to win the game in 1 turn. - -## Source -Naturally, the source for this was written in javascript, and relies heavily on the fact that the wiki game uses jQuery so I can plug into components and events really easily. The code can be found in the GitHub gists below. Both the standard and compact versions are available. - - +As it turns out, it really isn't very hard! It does require injecting some JS into the page, but it's not that much. ## Usage -1. Start a new game on [Wiki Game](http://thewikigame.com/speed-race), __don't__ press start! -2. Open your browser's developers console. This will vary from browser. -3. Open the Javascript console -4. Paste the compact version of the code there, and execute it (press enter) -5. Congratulations, you just won! +1. Start a [new game](http://thewikigame.com/speed-race), __don't__ press start! +2. Open your browser's developer console. This will vary from browser. +3. Paste the compact version of the code (`wiki-game-solver.min.js`), and execute it (press enter) +4. Congratulations, you just won! -If you want to win more games, just re-paste the code, it works as often as you like! + +## How it works +The game isn't open source, so I couldn't see how the back end worked, but after playing a few games and checking what happened on the page, I worked out what it was doing. + +The game was won when the iframe was at the final page location, or at least a clone of it on their servers with some extra querystring information. + +With this, I started to write something that would change the location of the iframe to the goal. Fortunately for me, the goal url was on the page. So all it took was a little mutative switcheroo to win! + +### Source +The source for this was written in pure JS, and relies heavily on the fact that the wiki game uses jQuery so I can plug into components and events really easily. The code can be found in the GitHub gists below. Both the standard and compact versions are available. + + ### Disclaimer - As I experienced whilst developing this, the people that play Wiki Game don't tend to like people cheating. There were a lot of people getting very annoyed whilst I was developing and testing. So please use this at your own risk! At the moment I don't think there is any kind of banning system, but be warned! diff --git a/content/projects/yoga-pal.md b/content/projects/yoga-pal.md index 18f189d..2e10257 100644 --- a/content/projects/yoga-pal.md +++ b/content/projects/yoga-pal.md @@ -6,8 +6,27 @@ repo: https://github.com/RealOrangeOne/yoga-pal summary: Control screen rotation, touch screen, and trackpad using the terminal --- -Once I started work, I bought myself a _Lenovo Yoga 3 14"_ laptop, because I needed a thin and light for trains etc. Unfortunately this came with windows, which within 10 minutes was running Ubuntu Gnome! Ubuntu greatly increased the performance, but I had to sacrifice all the screen, touchpad and keyboard customisation when changing 'modes'. +Once I started work, I bought myself a _Lenovo Yoga 3 14"_ laptop, because I needed a thin and light laptop for trains and the office. This came with windows, which within 10 minutes was running Ubuntu Gnome! Ubuntu greatly increased the performance, but I had to sacrifice all the screen, touchpad and keyboard customisation when changing 'modes'. -I found [this thread](https://askubuntu.com/questions/450066/rotate-touchscreen-and-disable-the-touchpad-on-yoga-2-pro-in-rotated-mode) on _Ask Ubuntu_ with someone else trying to find a solution to this, to find a nice way of rotating the screen when in tablet mode. On the thread was a really nice simple [script](https://askubuntu.com/a/485685/432138) that rotated the screen perfectly, and did the touchscreen too. This script worked great, doing exactly what it said it did, nicely and quickly, however it wasn't a great solution for me. Yes it worked, but it didn't allow me to change anything else, like the touchpad. +I found [this thread](https://askubuntu.com/questions/450066/rotate-touchscreen-and-disable-the-touchpad-on-yoga-2-pro-in-rotated-mode) with someone else trying to find a solution to this, to find a nice way of rotating the screen when in tablet mode. On the thread was a really nice simple [script](https://askubuntu.com/a/485685/432138) that rotated the screen perfectly, and did the touchscreen too. -So I started working on my own CLI, based off the above script, to allow me to tweak everything, so the laptop can be used as it was intended. +This script worked great, doing exactly what it said it did, nicely and quickly, however it wasn't a great solution for me. Yes it worked, but it didn't allow me to change anything else, like the touchpad. + +So I wrote my own CLI, based off the above script, that would allow me to tweak everything, so the laptop can be used as it was intended. With a simple command, I could swap the _mode_ of the laptop to match how I was using it. + +Eg: + +```bash +$ yoga mode tablet # Set to tablet mode +$ yoga mode laptop # Reset to laptop mode +``` + +After writing this, It ended up finding an accidental usage. The touchscreen started glitching out, causing ghost presses on the screen, making the mouse move all over the screen and switch focus all over the place. Fortunately, I'd already written a command to disable the touch screen and prevent this: + +```bash +$ yoga disable touch +``` + +Problem solved! + +Whilst I've only tested this on my laptop, there's no reason it shouldn't work on others too! If it doesn't, submit an [issue]({{ article.repo }}/issues/)!