Rahul's Website

Tech, coding, security and other random stuff...

Rickroll WiFi

Jun 292017

Original posted on 22nd September 2016 at http://rahul2001.com/weblog/2016/09/rickroll-wifi

 

undefined

Rickroll WiFi is an awesome script which rickrolls whoever is searching for a WiFi network by changing the SSID of a hotspot to the lyrics of Never Gonna Give You Up.

undefined

undefined

An online friend of mine came up with this idea originally. I thought it was a great prank, but I don't currently have an Arduino... So Rickroll WiFi for Windows was born.

Here's the source code (licensed under the MIT License):

@echo off 
title Rickroll WiFi for Windows
echo Rickroll WiFi for Windows
echo by http://rahul2001.com/
:Main
FOR /F "tokens=*" %%G IN (rickme.txt) DO (
netsh wlan set hostednetwork ssid="%%G" key=rahul_is_so_cool! >nul
netsh wlan start hostednetwork >nul
echo CURRENT SSID: %%G
timeout /t 1 >nul
netsh wlan stop hostednetwork >nul
)
echo REPEAT!
goto :Main

Save it as a batch file, and run it with administrator privileges. Be sure to change the password, and save all your data in rickme.txt. It will change the SSID every second with the subsequent line from the text file.

Here's what it looks like on Windows:

undefined

 

Here's what the rickme.txt file should look like:

NEVER GONNA GIVE YOU UP
NEVER GONNA LET YOU DOWN
NEVER GONNA MAKE YOU CRY
NEVER GONNA SAY GOODBYE

It literally took me 5 minutes to write this :P
It is still pretty crude though, and I'll update the code when I manage to make it a bit smoother.

The only disadvantage is that the SSID of a WiFi network cannot be longer than 32 characters, so all the lyrics don't work.
Unfortunately, the SSID doesn't change smoothly on Windows, but it still looks pretty cool :)

More information about how this works can be found here.

Get the old Android email app back

Jun 292017

Original posted on 15th June 2016 at http://rahul2001.com/weblog/2016/06/get-the-old-android-email-app-back

I really liked the default email app that used to come with Android. The bare-bones interface used to get the job done without any hassle.

Unfortunately, Google decided to kill it with Lollipop and integrated all other email services with Gmail. This was an unwelcome decision - I like to keep my inboxes separate... I tried some other apps on the play store, but most didn't work well, and the ones which did were filled with ads or required payment for basic features.

So I borrowed my friend's phone which still ran KitKat, and extracted the apk for the stock email app. This is the last working version of the app ever released. It doesn't have the material design icon, but that doesn't really matter...

You can download it here.

What are the different 'levels' of the Deep Web?

Jun 292017

Original posted on 8th June 2016 at http://rahul2001.com/weblog/2016/06/what-are-the-different-levels-of-the-deep-web

These aren't official, just general internet slang:

Level 0

The stuff you browse everyday: YouTube, DuckDuckGo, Facebook, etc.

Level 1 - Surface Web

This level is still accessible through normal means, but contains "darker" websites, such as Reddit.

Level 2 - Bergie Web

This level is the last one normally accessible: all levels that follow this one have to be accessed with a proxy, Tor or by modifying your hardware. In this level you can find some “underground” but still indexed websites, such as 4chan.

Level 3 - Deep Web

The first part of this level has to be accessed with a proxy. It contains Hacking, Adult Content, etc. This is the beginning of the Deep Web. The second part of this level is only accessible through Tor, and contains similar stuff.

Level 4 - Charter Web

This level is also divided in two parts. The first can be accessed through Tor. Things such as drug and human trafficking, banned movies and books and black markets exist there.

The second part can be accessed through a hardware modification: a “Closed Shell System”. This is serious. This part of the Charter Web contains Illegal Content, experimental hardware information ("Gadolinium Gallium Garnet Quantum Electronic Processors"), but also darker information, such as the "Law of 13", World War 2 experiments, and even the location of Atlantis.

Level 5 - Mariana's Web

A place where AIs come together and comment on cat videos. You need access to quantum computers to see this stuff...

Running Downloaded Apps in Safe Mode [Android]

Jun 292017

Original posted on 7th June 2016 at http://rahul2001.com/weblog/2016/06/running-downloaded-apps-in-safe-mode

Safe Mode can be really useful on your phone, when an app starts to misbehave, your phone starts crashing or your phone is infected by malware.

But what if you really need that superb backup tool you love? Well, don't fret, because I have the perfect solution for you...

UPDATE: This technique has been tested on the following devices:

  • Moto G (Turbo Edition) (Android 6.0.1)
  • Samsung Galaxy Note 5 (Android 5.1.1)
  • HTC Desire 816 (Android 5.0.1)

NOTE: This technique relies on something really simple that was probably overlooked by the developers and may be fixed in the future. I will be posting updates soon...

Step 1

Open the app in normal mode. 

undefined

Step 2

Exit the app, but make sure you don't swipe it away from the 'Recent Apps' menu. 

undefined

Step 3

Reboot into Safe Mode by long-pressing the 'Power Off' option. The method to enter Safe Mode may vary on some devices. 

undefined

Step 4

You won't be able to run the app in Safe Mode 

undefined

Step 5

Open the 'Recent Apps' menu in Safe Mode

 undefined

Step 6

Tap on the app, and you will be able to run it. 

undefined

Enjoy!

Create and Enter a Directory in Command Prompt

Jun 292017

Original posted on 5th June 2016 at http://rahul2001.com/weblog/2016/06/create-and-enter-a-directory-in-command-prompt.

Often while using command prompt, I want to create a directory and enter it. To do this I need to type in the following:

C:\Users\Rahul\Documents\Coding>md mydirectory
C:\Users\Rahul\Documents\Coding>cd mydirectory

This is such basic stuff, you would think that Windows would have functionality to do this with one command... But does it? No.

Which is why I've come up with the ultimate solution... Which is just common sense, really.

  • Open up command prompt and type copy con mdc.cmd.
    This let's you create and edit the file 'mdc.cmd', which is located by default in the System32 Folder.

  • Type @md %1 && cd /d %1, and press enter. These commends basically pass on the first command line argument of mdc.cmd to md, and then chose that directory with cd /d. I like to have the /d switch because it allows us to switch the current drive as well, but it is totally up to you.

  • Press Ctrl+Z and hit enter to stop editing the file.

Now everytime you want to create and enter a directory, just enter mdc mydirectory and Command Prompt will automatically enter mydirectory after creating it.

My Portable C/C++ Coding Setup with Notepad++

Jun 292017

(or... How I got MinGW to work with Notepad++)

Original posted on 18th May 2016 at http://rahul2001.com/weblog/2016/05/my-portable-cc-coding-set-up-with-notepad

A few days ago, I decided to finally start learning C++. Until now I've only used a rather restricted version of C for robotics. However, I faced a problem: I never do all my work on a single PC. Sometimes I work in school, sometimes at home on my desktop, and sometimes at my grandparents' house on my laptop.
I usually use a portable version of Notepad++ for coding, but then again, most of my code is either web development or batch scripting - stuff that doesn't need a compiler.

Getting g++ to work with proper Notepad++ installations is easy, but this method doesn't work with portable versions since you cannot rely on environment variables. So I spent some time thinking about this issue, and came up with the following solution to integrate a portable version of Notepad++, my favorite editor, with MinGW:

  • Download Notepad++ Portable
  • Add the NppExec plugin from the Plugin Manager.
  • Download MinGW for Windows.
  • Extract the contents of the archive you downloaded.
  • Copy both to a portable drive.
  • Download this small utility I made: r-launch. This basically allows you to run MinGW commands from the Notepad++ directory.
  • Save r-launch.exe to the Notepad++Portable\App\Notepad++ folder of your portable installation.
  • Create a text file called r-launch.txt in the same directory and store the path of the MinGW installation in it. My MinGW installation was in G:\Coding\MinGW and my Notepad++ executable was in G:\Software\Notepad++Portable\App\Notepad++, so my text file read:
    ..\..\..\..\Coding\MinGW
  • Open the NppExec windows in Notepad++ and type your MinGW commands like you normally would, only with r-launch.exe in front of them.
  • You're Done!

Here's the code I use in the NppExec window:

Compile:
Saves and compiles in the same directory with the same name

npp_save
$(NPP_DIRECTORY)\r-launch.exe g++ "$(FULL_CURRENT_PATH)" -o $(CURRENT_DIRECTORY)\$(NAME_PART).exe

Run in NppExec Console:
Runs the compiled version of the program.

    $(CURRENT_DIRECTORY)\$(NAME_PART).exe

Run in cmd:
Runs the compiled version of the program.

npp_run CURRENT_DIRECTORY)\$(NAME_PART).exe

Compile and Run in NppExec Console:

npp_save
$(NPP_DIRECTORY)\r-launch.exe g++ "$(FULL_CURRENT_PATH)" -o $(CURRENT_DIRECTORY)\$(NAME_PART).exe
$(CURRENT_DIRECTORY)\$(NAME_PART).exe

Compile and Run in cmd:

npp_save
$(NPP_DIRECTORY)\r-launch.exe g++ "$(FULL_CURRENT_PATH)" -o $(CURRENT_DIRECTORY)\$(NAME_PART).exe
npp_run $(CURRENT_DIRECTORY)\$(NAME_PART).exe

These commands use g++, but you can use any of the utilities that comes with MinGW.

Enjoy!


The source code of r-launch (licensed under the MIT License):

@echo off
Title r-launch: Rahul's MinGW Launcher
if [%1]==[] goto :help
goto :launch

:help
echo r-launch: Rahul's MinGW Launcher for Notepad++
echo http://rahul2001.com/
echo ----------------------------------------------
echo This file lets you add the MinGW utilities to
echo Notepad++.
echo:
echo Instructions:
echo 1. Save this executable to the same folder as
echo    the Notepad++.
echo 2. Save the path of the MinGW folder in a text
echo    file named 'r-launch.txt' in the same 
echo    folder as this executable.
echo 3. Run your commands with 'r-launch' in front
echo    of them from the NppExec plugin for
echo    Notepad++.
if %0 == "%~0" pause
goto :eof

:launch
(
set /p path=
)<r-launch.txt

if not exist r-launch.txt goto error1
if not exist notepad++.exe goto error2
if not exist %path% goto error3
if not exist %path%\set_distro_paths.bat goto error4

call %path%\set_distro_paths.bat
%*
goto :eof

:error1
echo ERROR: 'r-launch.txt' doesn't exist in the same directory as this executable.
goto :eof
:error2
echo ERROR: 'notepad++.exe' doesn't exist in the same directory as this executable.
goto :eof
:error3
echo ERROR: The directory specified in r-launch.txt doesn't exist.
goto :eof
:error4
echo ERROR: 'set_distro_paths.bat' doesn't exist at in the directory specified in r-launch.txt.
goto :eof