Sign in to follow this  
Followers 0
dual

Quick and dirty

5 posts in this topic

So this thread is for those quick and dirty hacks that you don't even think about; those hacks that pop out of necessity and just stick around cuz they're useful. This first one came from a time when I was at a car dealership which provided wifi for waiting customers. They also provided access to their corporate intranet and I wanted a quick, automated way to see what was there.

It started with map...

#!/bin/bash
nmap -n -sP -PI $(ifconfig en1 | head -3 | tail -1 | awk '{print $2}' | awk -F. '{print $1"."$2"."$3}').1-254 | tee ~/map.txt

and then went to scanall, using scan...

#!/bin/bash
for i in $(grep "up\." ~/map.txt | awk '{print $2}'); do
echo
echo ">>> Scanning $i..."
scan $i
done

#!/bin/bash
nmap -n -P0 -sS -O $1

And wrapped all up with now.

#!/bin/bash
map && scanall | tee ~/scanall.txt

Get an IP, type "now" and we're off. Yes, it's noisy and there's probably a better way to do it. They can be used individually as needed. So, what are your quick and dirties?

0

Share this post


Link to post
Share on other sites

I wanted a quick and easy way to extract the audio from YouTube (music)videos which are stored in one folder.

@ECHO OFF

IF "%1"=="" GOTO END

IF NOT EXIST %1 mkdir %1

FOR %%a in (*.flv) do helper.bat %1 %%a %2

:END

HELPER.BAT

SET _Path=%1
SET _FileName=%2
SET _FileName=\%_FileName:~0,-4%.mp3

FOR /f "tokens=1,2 delims=-" %%a in ("%_FileName%") do set _Interpret=%%a&set _SongTitle=%%b

SET _Interpret=%_Interpret:_= %
SET _SongTitle=%_SongTitle:_= %

ffmpeg -i %2 -acodec "copy" -title "%_SongTitle:~1,-4%" -author "%_Interpret:~1,-1%" %_Path%%_FileName%

IF "%3"=="-d" DEL %2

SET _Path=
SET _FileName=

Uses ffmpeg.

0

Share this post


Link to post
Share on other sites

Sorry to break the line of leetness, but I was always wondering how people get into those "databases" and "records" of doctor's offices, car dealerships. How exactly does this work? I just cant grab a clue about it. I would be really grateful if someone explained this to me. Thanks.

*******

Completely disregard this. :)

Edited by thepcdude
0

Share this post


Link to post
Share on other sites

First of all, way to thread hijack! And I don't think anybody here is going to answer your question... you might want to check the forum rules.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0