Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Oct 5, 2018

How I remotely found out the IP of my home computer after my ISP changed it.

I asked nicely 1 million machines if they were my computer. That's the short answer. Now for the long one:

I was using ssh to remotely work on my home machine. I was out for few weeks and the IP address only changes every few months, so I thought I was safe.

In reality it took less time for the IP to change. So I needed a plan...

Since I didn't setup a dyndns, or had anyone who could to tell me the new IP, I had to hack it out!

Fortunately I found a a list of the IPs used by each ISP in Portugal.


I then proceeded to fingerprint the machines.  I knew my machine had port 3000 open, so I needed to find machines with port 3000 open

sudo nmap -p3000 --open 5.43.0-63.1-254 5.158.0-63.1-254 5.249.0-127.1-254 37.28.192-255.1-254 46.189.128-255.1-254 77.54.0-255.1-254 78.137.192-255.1-254 83.174.0-63.1-254 87.103.0-127.1-254 89.114-115.0-255.1-254 93.108.0-255.1-254 94.60-63.0-255.1-254 95.136.0-127.1-254 148.63.0-255.1-254 148.69.0-255.1-254 148.71.0-255.1-254 149.90.0-255.1-254 161.230.0-255.1-254 178.166.0-127.1-254 188.37.0-255.1-254 212.18.160-191.1-254 213.30.0-127.1-254 -oN nmap_output.txt

I built this command that will analyse about ~1.000.000 IP addresses and figure out which have the port I want open, producing a list. This took about a day to complete.

It was then a matter of parsing the result. First I removed the RTT warning lines and got only the lines with IP addresses.

grep -v RTT nmap_output.txt | grep report > without_errors.txt

producing a list like this:

...
Nmap scan report for 11.11.11.11.rev.vodafone.pt (11.11.11.11)
Nmap scan report for 22.22.22.22.rev.vodafone.pt (22.22.22.22)
Nmap scan report for 33.33.33.33.rev.vodafone.pt (33.33.33.33)
...

I parsed this list to get just the IP addresses, using cut and a regex with sed.

cat without_errors.txt | cut -d' ' -f6 | sed "s/(//" | sed "s/)//" > only_ips.txt

Producing a list like this

...
11.11.11.11
22.22.22.22
33.33.33.33
...

And now I finally had a list which I could try to login into:

for i in $(cat only_ips.txt);do ssh -o StrictHostKeyChecking=no -o BatchMode=yes -o ConnectTimeout=2 -p22 $i "echo $i";done 2> /dev/null


And TADAM! I found my new IP address.

You could also first refine your fingerprinted result by finding machines that have another port open that you know to be open.

nmap -iL only_ips.txt -p2000 --open


I am sure there would be more efficient ways to do this, but I hope this can be useful to someone. :)

Jan 30, 2014

Linux Adventures! Chapter One: to Pick and to Install (Jun 2015)


linux mario
Hallo there!

This here two-part post will describe my current attempt at successfully discarding all my power-user knowledge of Windows and becoming a successful Linux guy.

Part one is about picking and installing. If you already did this, just go to part two, it's where the juice is.

So, ok! Here we go!

Picking your distro! 

 

Linux is cool cause you can see more of the stuff working, like a car that can turns its parts transparent whenever you want. "Whenever" is the key word for me. You may preach all you want, it still requires a bit too much information for Linux to be fun to use. And like all machines, it lies to you.

It starts with picking your Linux flavor. Too much choice! Not only that, there's also the legions of fanboys and guys that just want to belong to a club or show off their arbitrary skillzs. Eish... :(

From much reading I can now say the good easy and safe distros for newbies are Fedora, Debian, openSuse, and maybe Mageia. You then can pick variations of them, like Ubuntu, Mint or whatnot. Which in turn can have variations, like Lubuntu, Xubuntu. And then sometimes you can pick the graphical environment you want: Gnome, XFCE, LXDE.

lots of linuxesSo much choice. So, how to chose? Best way to chose, pick what your friends are using. Second best way to chose, pick the one that works for what you are going to use.

Most of my friends don't like Linux. I want to use Steam, some Windows applications and games, have good driver support, have a large user-base to draw knowledge from, lots of applications to try and use.




Also, I wanted a light graphical interface, but a non-distro specific one, so that I can eventually try other distros but keep the same interface.

So, until SteamOS stops being Beta, the logical choice would be Ubuntu LTS (long term, which usually means that it's a bit last year) and is the only distro officially supported by Steam. But yeah, I was not gonna do that. So instead, by looking around the logical choice I found the most recent Lubuntu. And if it works: close enough.

Installing your distro!


Installing Linux? Easy.

If you are on windows just Google the appropriate website. Choose between the 32bit or the 64bit version (32bit if you have 4GiB or less memory, else 64bit). Then you need to put that file you got into a pen that you can boot from. For that you need software. If you are on Windows use the universal usb installer.  On Linux there's a bunch of stuff, but for example, the Ubuntu family has its own way to do this, you can run the Usb Creator, or usb-creator-gtk.


So now you boot from the pen, if you don't know how to do this, ask a friend to do it. But it usually involves just pressing a key on the keyboard during computer startup and/or changing a setting inside the BIOS.

When you enter the installation, make sure you pick all the optional stuff. It doesn't hurt to have, it can hurt not to have.

The only part that can be problematic if you take the custom path is the partitioning.  I will now show my way of creating things for a single boot system (this means no Windows). Skip this step if it seems complicated and just select one of the default installation paths.

type     format  mount
primary  EXT4 -> root (or .)
primary  SWAP -> swap
extendable (and inside that):
extended EXT4 -> home

try understanding that text above by looking at this graph:


the partition I dedicate to the home folder gives me the ability to keep my stuff when I format (which on a non LTS version of Linux should be about once every 6 months). Speaking in Windows terms: it's like I reserved a special place in the hard disk for the My Documents folder, so I can upgrade easily and keep all my stuff.

If you want to take it slow and keep Windows, you should plan ahead when you install Windows and leave some space on your disk for Linux. And then you can install Linux on that empty space.

This is all for part one. When it finishes installing, it will seem ready but it ain't.

Welcome to Linux, newbie.
"Go back to Windows, you fruit-tart!"

Click here for Linux Adventures: Chapter Two: The art of making it all work better.


fullmooninu, 2014
images by their respective  creators
mario-tux by santang

Sep 20, 2011

(Portuguese) Gerar passos de dança para Stepmania

Este tutorial serve para explicar uma maneira fácil e não propensa a erros, de adicionar músicas ao Stepmania.

Utiliza o software Dancing Monkeys e explica os truques necessários para que o Dancing Monkeys consiga gerar passos para a maior parte das canções.





É necessário:

    1. Faça download das versões mais recentes do software listado acima.

    A instalação actual do Dancing Monkeys não é compatível com o Windows 7. Corra a instalação em modo de compatibilidade com Windows XP (SP2) para que não hajam erros.

    2. Escolha uma música. Isto em princípio será um ficheiro .mp3 , mas pode ser outro ficheiro qualquer, desde que o Foobar o reconheça.

    O Foobar toca quase todos os tipos de ficheiros audio em existência, se necessário instale o plugin correspondente, disponível no site official.

    Temos agora um ficheiro que o Foobar é capaz de tocar.

    Sep 13, 2011

    Tutorial: Setting up a quick online radio for your friends.

    If you are a gamer or something of the like and you would like to setup a quick online radio, for you and your friends to enjoy the same music while playing, this is the tutorial for you.

    If you want to play music for people on Teamspeak or something, just keep reading.

     After trying several tools, I came to the conclusion that presently, the easiest way to setup an online radio is by using the Shoutcast + Winamp combo. 

    Install Winamp
    First, get and install the latest Winamp .

    Install Shoutcast
     Now here comes the catch: the latest Shoucast does not bring a graphic interface. If you want to do this easily, and not have to mess around in files, get an older version. You can get it around the web. Search for Shoutcast 1 9 8 . Try this download link first, it's where I got it.

    Install it. Shoutcast is ready to broadcast to port 8000. No configuration required. Easy so far.

    Install Shoutcast DSP
    Finally, you will need to install the Shoucast DSP for Winamp, for the two, Winamp and Shoutcast, to communicate. Again, an older version is better here, for compatibility purposes and for better integrated mp3 support.

    I used version 1.90, so search the internet for Shoutcast DSP 1 9 0. Try this download link first.

    Install the DSP. Open winamp and the DSP menu should appear. If not, find it inside Winamp options.

    Using it
    All you have to do is to put files playing on winamp, and tell your friends to open the address on their media player. Most players will be able to do this easily.
     
    For example, put a playlist playing, tell them to open http://yourIP:8000 .


    In some cases the default 8000 port will not work, so change that in the Shoutcast settings.

    Aug 30, 2010

    (Portuguese) Ler Manga ou Comics no PC ou "O melhor leitor de mangapara PC: MangaMeeya"


    "Manga e PCs, o que é isso?"



    Toda a gente nos dias que correm já tem ou teve algum ficheiro ou varios ficheiros de manga/comics/webcomics no PC.

    Se bem que a geração mais recente de cybernautas é menos proficiente a nível informático que a anterior, e não consegue explorar todos os recantos da vasta internet, é também muito mais fácil encontrar o que se procura hoje em dia.

    O Rapidshare e seus irmãos , e especialmente os torrents facilitam o acesso a todo o género de downloads.

    Não julguem imediatemente que estou a dizer para irem sacar manga à net e lerem no PC. Por várias razões:
    1. os fans têm o dever de comprar coisas aos autores de que gostam para que continuem a produzir mais coisas;
    2. existem mesmo vários mangas/comics que foram lançados de forma gratuita na internet ou autores que não são contra a distribuição destes;
    3. existe muita gente que saca e lê e depois compra, ou vice-versa;
    4. existem já algumas editoras a vender manga sob formato digital.

    Nota: Quando digo "comprar coisas aos autores" refiro-me a todo o género de mercadoria baseada numa série. Podem alegar que alguém que tenha todos os volumes e série animada de Naruto no PC sem ter comprado nenhum fascículo ou DVD, é um fan desnaturado e irresponsável.
     Mas muitas vezes o mesmo fan tem o armário cheio de figurinhas de plástico de 80€ cada, e o quarto coberto com posters de Naruto. Este género de coisas também contam para o artista.

    E muitas vezes mesmo que não tenham comprado nada, são estes os fans que formam o grosso do núcleo inicial e extremamente fiel que torna uma série popular e memorável.

    Continuando a história: