Reparing two PS2 Slim’s

Before starting, I just wanted to say that the italian version of this post will soon be available on my dad’s website

Some time ago (how long precisely, even he doesn’t know) my dad bought two PS2 Slim’s at a flea market for a few bucks. In an unknown state, but including the external 8.5V power supply, he figured out they would be fun to (eventually) restore together.

As it turns out, they both had some problems and weren’t completely functional: one had a little piece of paper inside the DVD bay saying “laser to be changed”. It could boot fine, but had indeed trouble reading data from DVDs. The other had the power LED turned red when the power supply was plugged in but pressing the power button resulted in the power LED turning briefly green and then red again.

Red Light, Green Light. Red Light again.

I worked on the second one first. I never owned a PS2 myself, nor a PlayStation in general, so I’m totally new to this world. Searching on the internet, I found some interesting insights about the problem. Regarding regular PS2’s, iFixit said that such a problem could be a a failing power switch on the back. Unfortunately, PS2 Slim’s don’t have such power switch, so back to the drawing board. At visual inspection, the board looked fine, no apparently damaged or burned components, so the only thing i could think about, given my (little) previous experience in this kind of repairs, was some kind of short-circuit or other failure on some power line. Here’s what the console did when trying to turn it on:

Making the semaphore work again

I came across this video on youtube saying that fuses failing are common and some posts on r/consolerepair stated that the fuse PS17 is a common point of failure. Since a fuse that is not blown is just a short circuit, I started checking all the fuses on the board with my multimeter, finding three that were blown. One of them looked suspiciously like a capacitor, but the shell was white, which is uncommon for a cap. So I desoldered and checked it with a capacimeter to be sure it was (or wasn’t) a cap. Turns out it was a 100nF one. The other two, had clear markings which recognized them as fuses.

As a test, I shorted the two blown fuses, tried to turn the console on, and it actually worked!

And the console booting:

Yes, yes I know just shorting fuses is very very bad practice, since you never know if they’ve broken because of aging (this console is almost 20 years old!) or they’ve blown as a consequence of something else malfunctioning. Unfortunately I did not have replacement fuses available, but I don’t plan on using this console until they arrive. When they, do, I’ll replace them and further investigate the fault if they blow again.

Number 2

I found a piece of paper inside the DVD drive bay which said “Laser to be changed”. I noticed immediately that the outer plastic of the console was severely bent. Opening the console, it was clear that someone else had already been inside as the console was modded using the Matrix Infinite mod, which is used to bypass DVD copy protection. When putting it back together, the plastic was so deformed that I was almost unable to close the console.

Since I was inside, I took the opportunity to clean the dust with off the DVD reader with some IPA and Q-tips and spray the mechanism with some good old WD-40, paying attention not to spill neither IPA nor WD-40 on the lens.

The console booted fine, showing the Matrix mod splash screen at startup, right before the Sony logo.

I tried loading some original DVD that were bought together with the console. At first the DVD wouldn’t even start spinning. But pressing on the bent part of the plastic lid the drive started spinning and actually reading what was on the DVD and started the game. This led me to think that there were some switches under the DVD lid used to detected when the lid is closed. With the lid being bent, the switched where not being pressed and therefore the DVD would not start spinning. So I used an hot hair gun to warm the plastic lid and bent it back into shape, being careful not to overheat the plastic and melt it down. Here’s the result:

After being, the DVD drive work flawlessly. This console was modded by the previous owner to bypass the DVD copy protection, so it can also read non-original discs.

Conclusion

I usually love repairing electronics, and this two consoles were much fun. See you next time!

I made a Google Meet Bot to attend online lessons for me

Before Reading

As always, the source code for this Google Meet Bot is available on my github profile. You can even download it and set it up for your own use following the instructions! If you want to see the bot in action take a look here

The Problem

I’ll be honest, I’ve never been the kind of person that wakes up early in the morning and it’s super energetic right off the bat. Even if i wake up at 7am, getting out of the bed takes me ages. Now, since the COVID-19 outbreak in my country, schools have moved to online lessons countrywide. Even if by now we go physically to school for 75% of the week, we still have to attend online classes for the other 25%. This whole time, knowing i had to stay at home to follow my lessons made waking up early even harder for me. And apparently keeping note of who arrives to a lesson late is apparently a huge problem, which neither me nor my teachers want to deal with.

What to do?

I had to do something for this situation, and getting up in time was simply not an option. I needed something that could join lessons on time for me, which allowed me to sleep more. So i needed something to automate my computer, but how? I could write some program that simulated the mouse moving and clicking, but I had to do it in the past and I knew it was terrible idea, so I ditched it. Yet, i needed something to simulate a person using the browser.

Looking at old projects

As I said, using some kind of program to virtually move the mouse and click stuff was totally not a good idea. At least not writing my own. Then i remembered that some time ago I worked on an Account Checker script for a friend. It was basically a program which, given a list of usernames and passwords, would try to login into websites. This was a nice and quick project that you can find here. I might do a post on it some day.

The Account Checker was based on the nsgodshall’s fork of zshell’s Hatch, it was written in Python and used a module called Selenium, which was exactly what i needed.

Selenium

It’s a simple yet extremely powerful website automation tool. Selenium can open an automated Firefox window, and it can simulate the click of buttons or typing of keys like if a person was using it. To do this, the browser has to be ready for automation. For Chrome, this means installing the chromedriver and giving the right path to it to the script. For Firefox, it means doing the same thing with the geckodriver. I decided to settle with Firefox because Chrome was giving me some strange problems with login in the early tests. While i was thinking of this, and had already made a somewhat working example, my youtube feed suggested me this video by TechRaj (how strange!). TechRaj made a bot to automatically join Microsoft Teams meetings, the same concept could be applied to Google Meet, but it had some serious problems to be solved

The Bot

The most important problem in this case, is that Google, unlike Microsoft, doesn’t allow google accounts to be joined from automated browser sessions. Second problem, is that, unlike TechRaj does, CSS Selectors cannot be used to select the components of a website, since the selector of a component changes on a per-meeting basis on GMeets. This second problem is quite easy to resolve by using XPATHs instead of CSS Selectors. An XPATH just a string that describes the position of a component in an HTML structure. XPATH are static, unless someone changes the HTML structure of the page, which shouldn’t happen really often on a service like GMeet.

The account problem is a little trickier to workaround, but I managed to find a way. FireFox has profiles, which retains information about the browsing history, cookies and, most importantly, accounts that are logged in. So we could create a new FireFox profile, manually login into the needed Google Account via GMail and let the profile store the account. Since this step has been done manually, without an automated browser, Google will let it login into the google account with no problems.

Then, using Selenium, we can open a new FireFox window that uses the profile we just created, and it will be automatically logged in into Google, struggle free.

From this point on is just a matter of using WebDriver.get, WebDriver.click and WebDriver.send_keys to click redirect the browser to the given Meet link, click the buttons to mute camera and microphone, join the call and eventually type something in the chat. At this point there’s only a scheduling system missing.

Scheduling

It wouldn’t be a real bot if it wasn’t able to automatically join classes at the right time, every day. Searching around i found the schedule module for python. Basically, as long as script runs, it will execute the given action at the right time of the right day. I did another bit of manual work and programmed the bot with my current lessons schedule.

Of course, a teacher could be late, so the bot is programmed to retry joining a meeting every minute if a failure of any type should occur.

Running in the background is the only thing left: my computer runs ArchLinux with KDE Plasma as Desktop Environment. KDE Plasma allows the user to create multiple Activities, which are basically virtual desktop isolated from each other. I created an activity for my school stuff, and let the bot run there.

Conclusion and Final Considerations

The bot is lightweight and easy to set up and use. I’ve been running this Google Meet bot for the past couples of months and hasn’t failed on me since, and I still haven’t got busted by my teachers.

Universal base converter

Why do Programmers confuse Halloween with Christmas?

Because 31 oct = 25 dec!

(Read somewhere over the internet)

A while ago I was doing some school exercises about decimal to binary conversion and this kind of stuff. If you know how this works, you know that doing lots of these conversions by hand can became quite boring after a while. So I decided to code myself a converter. But not just a converter that could do decimal-to-binary and viceversa, but one that could handle all kind of bases I knew.

As my Zip Bruteforcer, this program was made as a command line utility, with the only differences that this time I’ve used Python instead of Java.

Before telling you how I made this, I’d like to remember you that all the code is available on github, as always.

How It Works:

First of all we have to remember a very important thing: in everyday life, the numerical system we use is a base 10 system, this means that it can use all digits from 0 to 9. Generally, every numerical base uses digits in the range 0 up to (base-1).

This means that base 9 system uses digits in the range 0-8, base 8 system uses digits in the range 0-7 and so on.

What about bases greater than 10? For example base 16 (hexadecimal)?

Well, in that case we can use digits from 0 to 9, but we can’t use 10, 11, 12, 13, 14 and 15 as digits, because they’re numbers, made up of more than one digit. To overcome this problem we use letters: so A becomes 10, B becomes 11, C becomes 12 and so on.

The concept behind my converter is really simple:

As we’ll see later in this post, the steps to convert any number into a base 10 number are the same for every base, the only things that change depend on the base.

And it’s the same when you convert from base 10 to any other base.

My program simply converts the starting number into a base 10 number and then converts the result into another given base.

Converting any base into base 10:

First of all, we have to convert the starting number into a base 10 number. This program won’t mind if the base is already 10, this process we’ll be executed anyway. In this article, the base of a number is expressed inside parenthesis at the right of the number.

The conversion is really easy:

Starting from right, you multiply every digit of the number by the base elevated to a certain power. The exponent of this power is 0 for the number at the most right and increases by 1 as you go left. After the multiplication you add up all the results and you get the number converted into base 10.

Watching this image should be much easier to understand.

For example, we can try converting 1001110(2) to a base 10 number.

But this can also be applied to other bases, we can test it using the numbers from the joke in the introduction and check if it’s true:

Now that we verified that 31(8) is really 25(10) we can laugh at the joke.

This is it translated into some Python code

As you can see, this already includes a conversion from letters (A, B, C, D…) to the corresponding number (10, 11, 12, 13…).

Converting from base 10 to other base:

Now that we got a base 10 number, we need to convert into the new base.

When converting from base 10 to some other base, you simply divide the base 10 number by the new base, keeping the division rest and diving the result again by the new base. You  repeat this until the division result is 0. Then you take all the rests you got in order, flip them and you finally have the number expressed in the new base.

Let’s use the same numbers from the previous example:

As I said before, this works for every base, so we can test again if the intro joke is correct:

Now that we check again that the intro joke was correct, we can laugh once more.

Translated into code, it’s something like this:

As you can see, the code does exactly what I said before:

The number to be converted gets divided by the base until the result is 0 and the division rest gets stored in a list. Then the list with the rests is reversed and finally every number greater than or equal to 10 is replaced with the correspondent letter.

Adding special bases

But, when dealing with computers, sometimes you have to use some variants of the binary (base 2) system, such a Two’s Complements (expressed as CP2 is the program), mostly used to express negative binary numbers, and Binary Coded Decimal (expressed as BCD). This two systems simply need different calculations to be used, but they’re included in the number-base10-newbase logic of the converter.

Two’s Complement (CP2)

This is just a way to express signs with binary numbers. After converting a number into a binary number, you add a 0 at the most left. If the binary number has to be positive, the conversion is done; otherwise, if the number has to be negative, another step is required.

Starting from right to left, the number remains unchanged until you get a one. After that one, every number is inverted, so a 1 becomes a 0 and a 0 becomes a 1.

For example, as we saw before, 78(10) is 1001110(2). Since 78(10) is positive, in CP2 we have to add a 0 at the left of the number, so we have 01001110(CP2). But if we had -78(10) we add to apply the additional step to make the CP2 number negative.

So, first of all we get the positive corresponding number, 01001110(CP2), then we invert every number starting from after the first one at the right. -78(10) in CP2 is 10110010.

Converting from CP2 back into base 10 is the same as doing it for binary, with the only difference that is the most left bit is a 1, it gets subtracted instead of added to the others

Binary Coded Decimal (Bcd)

BCD is a simple way to express decimal numbers in binary: every digit of the number is expressed using 4 bits (since the higher digit we can have i 9, and it requires 4 bits).

If we try converting 369 into BCD:

And here’s the code:

Adding a nice menu

Now the only thing missing is a menu to easily use this converter, here is it:

Conclusion

And the converter is now done. I’d like to remind you that the code is available on my github account. In a future I should do a mobile app out of this, to use it on-the-go, since I didn’t have my computer with me when I needed this more than a couple of times.

Hope you like my work 😛

Voxel Engine

The Development History of my Voxel Engine

 

Almost two years ago I decided to start working on a Voxel Engine – knowing almost nothing about voxel engines.
This is not a guide to voxel engines nor a tutorial about making one, it’s just the report of my experience from scratch to a fully working project.

I decided to go with jMonkeyEngine, as Java was the only language I knew two years ago and I didn’t want to start from raw LWJGL, and this engine was easy to use for me. Nothing excludes that the code can’t be ported to other languages, and it’s probably something I’ll do to learn new languages quickly. Maybe in the future I can port this engine to other languages or rewrite it using OpenGL with LWJGL.

 

 

 

 

 

 

All my code is available on my GitHub profile: https://github.com/EmaMaker

 

Face Culling
My first test worked using strange formula to have less cubes as position on the y axis increased and used full cubes with a yellow-purple texture to test the borders.
This is the first big error when making a voxel engine.
Even if you see a world made out of cubes, in reality there are any. All the “cubes” are made of simple quads that appear or disappear based on what you need. For example, if you have two adjacent cubes with each cube touching a single face of the other, both cubes will have a face that won’t be seen by the user, so the simplest thing to do is just not rendering them and save workload on the GPU. This method is called Face Culling. You can read more about rendering methods for voxel engines in this very interesting article by 0fps.
I spent some months working on a better version of this face culling algorithm, fixing and tweaking the RAM usage due to some bad-practices I’ve used during the first test.
This version was based on a Cell object, that kept note of the faces to show during rendering. Cells are grouped into Chunks, making the progressive world generation much easier.

Chunks store a three-dimensional array of Cells, while the entire World is stored in a three-dimensional array of Chunks. I kept this structure for all the development.

But there were still some problems with this: the Cell generated six different objects that had do be rendered separately on screen: it used too much RAM and was still too much for the GPU. Despite this, it run at 100fps on my Dell XPS M1330, which now is a 12-years-old laptop. But when it came to generate new parts of the world, the Java Garbage Collector started crying for all the mess it had to clean.

 

Greedy Meshing to overcome perfomance issues

Speaking with some folks in the jMonkeyEngine Forums, I got the advice to abandon the six-objects method I had been using, in favour of GreedyMeshing. As you can read from in the 0fps’ article, greedy meshing constructs a single mesh for the cubes faces with same texture that are next to each other. I didn’t really understand the Maths that 0fps did,  as I’m still in high school and I haven’t studies most of the concepts he used yet, but I was successfull in writing my own. It’s quite dumb code, as it’s mostly made of if statements and while cycle with mostly no Maths in it, but it works well, and I’m happy with it.

This is a wirefram of a chunk mesh generated with greedy meshing

 

Smooth world generation using Simplex Noise

As I mentioned before, the early tests used a strange formula to generate less cubes on each layer as the position on the y-axis increased. This was abandoned in less than a couple of weeks, and I tried to have a smooth terrain generating ellipses starting for a center point, with the radius decreasing as the position on the position on the y-axis increased. But I started reading more and more about smooth pseudo-random terrain generation and I came across Perlin Noise, which sounded really interesting. I tried to implement Perlin Noise by myself, but after a couple of unsuccesfull tries, I found this Simplex Noise java implentation by SRombauts. Simplex Noise is computationally less expensive than Perlin Noise, which is can be really useful in this situation. I then adapted the Simplex Noise to my needs, added a couple of features for saving and loading the permutation table to and from file and the world generated was much more beatiful than before.

The first working test with Simplex Noise (left) and the first test ever with Simplex Noise (right)

At this point of the development, I decided to not use the Cell object anymore and replace them with simple integers inside the three-dimensional array. This saved up to 200MB of RAM when the player is still.

Saving and Loading from file

As I wanted to preserve the world when I closed the engine, I implemented a basic Chunk load/save system to save RAM by not keeping loaded Chunks that are very far apart from the player. This is also used to save the world when the game windows is closed and load it again when it’s reopened. The Chunks are saved in a plain text file, with each line corresponding to a single index of the 3d-array in the Chunk, with the x position, y position, z position and the id integer separated by spaces.

Along with the Chunks, also the Simplex Noise Permutation Table and the game settings are saved.

This system is absolutely bad, saving lots of Chunks requires even gigabytes of space on the disk, which is really insane.

MultiThreading, Block Picking and Customization.

Greedy Meshing and Loading Chunks from files require some time, which depends on the CPU and disk speed of the Computer. To remove this delay, which blocked the entire Main Thread of the game, I decided to load and generate Chunks in a separated thread, which doesn’t affect the main one. This makes the engine really smooth to run and the Chunks generating in front of you is really nice.

Implementing Block Picking alongside with MultiThreading was an hard time. jMonkeyEngine allows you to modify the scene only in the main thread, but I used to generate new Chunks in a secondary one. To solve this problem, I had to make the secondary thread only prepare the data for the chunk mesh, that the main thread uses to generate and show it.

Having the main features completed, it was time to implement some secondary ones. At first, during the making of the engine, I noticed I needed some way to make it more flexible to test different situations. So, I implemented lots of functions to do this: toggling debug messages, wireframe, test functions, changing the method used to generate the world, changing the size of the Chunks and of the world, adding new block types with just a couple of functions. This makes the engine way more flexible, also for other people, to use.

 

Conclusion

At this point, I can declare my Voxel Engine completely working, and I’m really happy with it. During those years of development (I have to specify that I abandoned the development even for months during this time), I learned lots of new things about games and programming in general which helped me becoming a better coder.

You can see all the history of the development on the github repo.

But my learing journey isn’t finished yet, I still have tons of new things to learn.

Java Zip Archive Bruteforcer

A while ago I was wondering how to access encrypted zip archives. A real dumb – but simple to make – way is to bruteforce every single possible password and try it to decrypt the archive with it. So I first wrote a little piece of code to bruteforce words from a given characters list. Here you can download the version written in python, but I decided to go for Java to make this program, as I haven’t started using python yet at the time. Then I had to interface my java program with the zip archives: I used the zip4j library, you can find it here.

Imported the library in the project, changed a little bit of code to make it use the generated passwords to unpack it, some other tweaks and it was done.

I decided to make the program look as a command-line utility, so I also added the arguments handling and an help menu.

Here’s a screenshot of how it looks in the Ubuntu terminal on my machine.

If you want to use this, here’s the jar executable, and you can also find the code on my GitHub.

A Cluster Story – Part 2: SSI, Mosix and future enhancements

As said at the end of the first part. in this one we’re gonna see how the cluster story ended for now and how I plan to modify it in the future (software speaking).

 

We looked how SSI Clusters work on Wikipedia. On the same page, there’s a nice and quite update list of SSI Cluster solution with relative features.

 

 

Reading that, I decided that OpenSSI or Kerrighed were the best solutions for our problem. Unfortunately enough, their development ended almost ten years ago. the only SSI Cluster solution that it’s still being developed is MOSIX, so I decided to go for it.

After CentOS with Rocks Cluster, I installed again Ubuntu Server 16.04 LTS on all the servers. After that, I followed this tutorial on youtube to set up the cluster with Mosix.

Unfortunately enough (again), MOSIX can’t be used for some of my needs, like building Android Custom ROMS, due to unsupported system calls. To avoid this, the plan is to virtualize a Kerrighed environment, and then built a Virtual Machine that uses all the kerrighed pros on top of it. This can be quite heavy in terms of performances, but I want to give it a try.

Another upgrade I want to do consists in adding the possibility to turn the whole cluster on remotely. This can be done using a Raspberry Pi B I have lying around and connecting its GPIOs to the motherboards, then writing a little python script to use them to simulate a motherboard power button.

 

For now, that’s all, I’ll keep you updated on the progress of the project

A Cluster Story – Part 1:Building and Parallel Computing

As I often do, I start a project just to learn about something. This time, I decided to build a computer cluster and I barely knew how clusters work.

I was at school and I asked a friend “How crazy would it be to build a cluster using old computers?”. “Quite crazy, but let’s do it”. And after school we were in my basement choosing the motherboards to use.

Even if we had lots of motherboards that only supported 32bits CPUs, we went for some 64bit Pentium 4 CPUs and relative motherboards. And this is short list of components that we used:

  • 2x Pentium 4 Dual Core 64bit @2.00GHz CPUs, on two different Asus motherboards, but I don’t remember the model, with 2GB RAM each
  • 1x AMD A8 Quad Core @ 2.60 GHz CPUs, on an Asus motherboard with 8GB or RAM. This combo was my friend’s and we used it for the cluster project
  • 1x Intel Core 2 Duo Dual Core @ 2.00GHz, on an Asus P5-Q motherboard, with 2GB RAM.
  • 2x IDE hard drive, 80GB each
  • 1x 280GB Sata 2 Drive
  • 1x 320GB Sata 2 Drive
  • 1x 80GB IDE hard drive

Testing components & installing Ubuntu Server

 

After a whole afternoon spent on testing RAMs, motherboards and components. We started installing Ubuntu Server on the three Pentium 4 motherboards we got working. Then we installed MPICH on each server, following this guide. And then the discovery: MPICH only worked for parallel computing. So I decided we needed a little bit more information about how clusters work, a bit of Wikipedia reading was enough.

 

 

MPICH install and config.

 

There are two main types of clusters: Parallel Clusters and Single System Image (SSI) Clusters.

  • Parallel clusters make each node run the same program. Programs have to be written to use this type of work division.
  • Single Sistem Image Clusters make multiple machines count as one, single, big machine.

SSI Cluster was what we needed.

We tried to use Rocks Cluster. It’s a fork of CentOS enhanced to build SSI clusters. Configuration was easy, using Rocks 6.2. Adding nodes to the cluster was quite hard on Rocks 7.0, so we decided to go back to 6.2. After some days of experiments we made our second discovery: Rocks Cluster is used to build Parallel Computing clusters.

Finally working Rocks Cluster

 

But having some bare bones components lying around in my room, since I share my bedroom with my sister, was quite annoying. So I decided to build a “closet” to host all the components

So, together with my Dad, I started cutting some pieces of wood we had lying in our basement and built a structure to hold all the nodes of the cluster and a monitor to use it.

Here are some photos of the plane used to old the nodes and the final structure.

 

 

 

 

 

 

 

Complete view of the cluster structure and of some of its parts

 

 

 

 

In the next part we will see how we solved the SSI problem and future enhancements

 

MakerFaire 2017

The MakerFaire 2017 and out project

The December of 2017 started with a beatiful experience: I took part, with some other friends and our parents, to the MakerFaire 2017. We had our own stand and we showed to the big public of the Faire our project. What was is about? It’s called 3DPacRobotMan and it’s a real-life version of the Pac-Man game. Pac-Man is a videogame that came out in the ’80s and still today is very famous.

Our version uses new technologies to make a funnier and cooperative version of the game:
The field is all made of laser-cutted wood. Under the field there are loads of tinier and bigger shields to control the LEDs, that, using a Reed Sensor, act like the original game’s coins. There are five characters: one is the Pac-Man and the others are the ghosts. The ghosts have to catch the Pac-Man, that has to escape from them. If the ghosts catch the Pac-Man they win, otherwise is the Pac-Man to win. The robots are made using Arduino Uno modified Boards and remote controlled with Radio Frequences @2.4GHz.

A Raspberry Pi serial communicates with the field to let the players see the score, the highscore, and plays the game sounds (This part was made by me).

I’d like to precise that all the hardware and the software was made by us.
Everyone liked our game and it was beatiful to see people, from kids to parents and schools, have fun playing a game that was made by us, with so much effort.
Because it was our game.


3D Pac Robot Man on The MagPi

Do you know the Raspberry Pi? It’s a credit-card sized computer, that you can buy for just 35$. The Raspberry Pi as it’s official magazine, called “The MagPi”. I had the luck to speak with the Raspberry Pi Foundation guys at the MakerFaire 2017 and I told them about our project. They liked it and they published and article about our project in the Febbruary 2018 Issue of the MagPi. Down here there are the photos of the two pages about our project, but you can always download it for free at magpi.cc



How to make an Home-Made VGA video cable simply and quickly

WARNING:

I DON’T take any responsability about what do you do. All you will do is  your responsability and your problem. This is only a tutorial.
 

I bet it’s happened to everyone that you needed a VGA cable but you didn’t have it.

The solution to this problem is very easy to understand and easy to make
You’ll need:
-A computer (All computer types are good, you just need a VGA plug as shown below)
-A VGA monitor(with a VGA plug as computer, shown below) . Also TVs are good, you just need that VGA plug.
-15 cables, as long as you want.
-Steady hand and lots, lots of patience.
Un entrata e un cavo vga, per intenderci
If you look carefully there hare fifteen little holes in the plug on your computer and on your monitor. This holes are called PINs
What the normal cable does is wiring the two plugs of the monitor and of the computer.
It’s very simple! You just have to wire a part of the cable in a PIN of the computer plug and the other part in the Monitor plug. For example: if you put a part of the cable in the PIN number 15, you have to wire the other part to the correspondent PIN number 15. (for PIN numbers see the photo up in the page).
If you understood of to put a cable, you can go ahead doing the other 14.

If you have done all of 15 wiring, you’ll have something like this:

(The photo isn’t great, but you can see the 15 pin wired).
As you can see (If you done all it well)the home-made cable will work and your screen will be duplicated, but changing the options you can extend the monitors or view only one of the two.

This should also work with DVI cables, just to the same thing for each PIN.

Decompile a Windows executable (.exe) written in Java

Very often the .jar executable files are converted in .exe executable to work with Windows.

 
Java is a programming language that can be decompiled using simple decompilers, in a lawfully way
The most famous decompiler is fernflower, you find all about it in this forum. Anyway, I often use JD-GUI, the download can be found here
Download one of those and put it in folder in the Desktop.
Or search for some decompilers online on Google, you always find something.
 
We will see two methods, one using JD-GUI and the other using fernflower.
 
We will decompile the 1.5.2 orginal Minecraft Launcher, that can be found here. 
Mine is called “Minecraft.exe”, yours should be called “Minecraft-1.5.2.exe” (maybe you will not have the “.exe” part, we will see later how to get it).
 
 

 

 

First method – Decompile by using JD-GUI

Move the downloaded file in a new folder and change the extension to “.exe” to “.zip”

Open JD-GUI by double clicking the jar executable.

Now open the zip file we just created go to File>Open File…> and choose the file we created

Now you JD-GUI workspace should look like this.

Go To File>Save All Files> and choose the directory when you want to save the zip file with the sources. You should import this file into an IDE to make it work.

 

 

Second method – Decompile by using fernflower (via command prompt)

  1. Rename “Minecraft.exe” in “Minecraft.jar”, with the method used for the JD-GUI to rename it in .zip
  2. Open the Command Prompt, hitting the button tasto Windows + R, typing cmd and hitting Enter
  3. Use the cd command to move to the directory the fernflower is in.
  4. Now in the Command Prompt write  java -jar fernflower.jar Minecraft.jar decomp/
  5. This will open the fernflower(fernflower.jar), sets the file to decompile to Minecraft.zip and put the decompiled jar in the decomp sub-folder in the fernflower folder.
  6. Enter the decomp sub-folder in the fernflower folder and rename the “Minecraft.jar” in “Minecraft.zip”
  7. Now you have your decompiled !   

In both cases, you will have to import the decompiled source code into an IDE.

I hope this was useful for your as it was for me! 😀