For a few weeks/months I’ve been struggling with the following matter at hand.

Old environment:
– Joomla website in “/
–  Smf installation in “/forum

Joomla was simply the front-end, providing news to our users while Smf was responsible for registrations, logins and maintenances of  members.

for years this worked perfectly but as time moved on a change for our site was necessary. Regarding the important use of Smf in this case  it was clear where our starting point would come from.

New environment: 

– WordPress installation in”/
– Smf installation in “/forum

I wanted to make sure that:

  1. users from Smf were able to login to WordPress
  2. users from Wp were able to login to Smf
  3. information from Smf could be used in Wp
  4. and the forum was integrated in WordPress

And so began an epic struggle:

Step 1. A bridge

bridgeSince Smf and WordPress are too different handling registration, logins, logouts and managing their “content”, we need something to overlap this, hence a bridge.

A search revealed that  a lot of these “bridges” are available for different types of blogs, forums and/or CMSs and most of them provide a basic functionality to sync the different databases so a login eg is possible in both.

Let’s see what’s out there.

My first approach was using a wp bridge for smf:  SMF Bridge

WP-SMF-Bridge is a simple user registration and logon bridge between WordPress and Simple Machine Forum. To get this working, it is highly recommended that you have a fresh, unmodified install of SMF 1.1 or higher installed and running alongside an install of WordPress. It must be installed in a subdirectory under your WP install and should not be being accessed through a sumdomain. For example, if your website’s address is mysite.mydomain.com, your forums should be somewhere like mysite.mydomain.com/myforum. Also, WordPress must be able to access your SMF configuration files, otherwise it won’t work!

Unfortunately, this plugin has not been updated since 2010-5-26 and didn’t make me use the SSI.php functions in wordpress.

Second approach: SMF2WP

SMF2WP is a simple one way bridge from Simple Machine Forum (v2.0.1 tested) to WordPress (v3.2.1 tested). This means, this one uses databases of SMF Forum and sync to WP database every time a user performs log-in action in both WP and SMF. […]

This plugin will do these following tasks:

  1. If a user log in WP, then that user will be logged in SMF using SMF2API.
  2. If a user logout WP, then that user will be logged out SMF using SMF2API.
  3. If a user log in SMF, will be logged in WP as well.
  4. If a user log out SMF, will be loged out WP as well.

When I was busy with this project, SMF 2.0RC came out and at that time SMF2WP didn’t work for me, so I was pushed in another way of achieving my goals.

Instead of using a WordPress plugin, why not go the other way around ? Use a Smf plugin which does the same. Since SMf was our basis from the beginning, this deemed to be a good solution.

Third approach: BlogBridger

BlogBridger is an Open Source PHP Application to bridge WordPress 3.0+ with SMF 2.0. It is released under the Mozilla Public License v1.1. BlogBridger makes no code changes to SMF, operating soley on it’s integration hooks. It is easy to install, uninstall and manage.
Features:

  1. Installable on new OR existing SMF and WordPress installations
  2. Migrates users to both SMF or WordPress if they do not exist in the other
  3. When a user logs into SMF, they are also logged into WordPress (vice versa)
  4. Assign WordPress roles to SMF member groups when exporting users from SMF
  5. Assign SMF Member groups to WordPress roles when importing users from WordPress

This could work ! After setup and installation I tried to login with wordpress and: Success! I was able to login using my smf credentials.

With this I was one step closer for reaching my goal.

2. How do you want your login sir ?

Login of SMF

I wanted to get rid of the login page that wordpress provides, so a few files needed some adjustments: ssi.php and header.php. (Ofcourse the wp-login.php can still be used, I simply did not let it show in my widget structure.)

This also allowed me to use the functions residing in smf.

ssi.php can be found in “/forum” and header.php can be found in
your “/wp-content/themes/<themename>” folder.

header.php

We need to change the  first lines. by adding ssi.php.
Change

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
  4.  
  5. <head profile="http://gmpg.org/xfn/11">
  6. <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
  7.  
  8. [...]

to

  1. <?php
  2. require_once('/forum/SSI.php');
  3. ?>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  5. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
  7.  
  8. <head profile="http://gmpg.org/xfn/11">
  9. <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

With this added line we can use variables from smf, let say: the loginbox

<div id=loginbox>
<?php  ssi_login(); ?>
</div>

But this gives us the entire loginform, we only need the username and password textfields. Thus requiring a little adjustment in ssi.php

Ssi.php

Change

  1. // Shows a login box.
  2. function ssi_login($redirect_to = '', $output_method = 'echo')
  3. {
  4. global $scripturl, $txt, $user_info, $context, $modSettings;
  5.  
  6. if ($redirect_to != '')
  7. $_SESSION['login_url'] = $redirect_to;
  8.  
  9. if ($output_method != 'echo' || !$user_info['is_guest'])
  10. return $user_info['is_guest'];
  11.  
  12. echo '
  13. <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '">
  14. <table border="0" cellspacing="1" cellpadding="0" class="ssi_table">
  15. <tr>
  16. <td align="right"><label for="user">', $txt['username'], ':</label>&nbsp;</td>
  17. <td><input type="text" id="user" name="user" size="9" value="', $user_info['username'], '" class="input_text" /></td>
  18. </tr><tr>
  19. <td align="right"><label for="passwrd">', $txt['password'], ':</label>&nbsp;</td>
  20. <td><input type="password" name="passwrd" id="passwrd" size="9" class="input_password" /></td>
  21. </tr>';

to

  1. // Shows a login box.
  2. function ssi_login($redirect_to = '', $output_method = 'echo')
  3. {
  4. global $scripturl, $txt, $user_info, $context, $modSettings;
  5.  
  6. if ($redirect_to != '')
  7. $_SESSION['login_url'] = $redirect_to;
  8.  
  9. if ($output_method != 'echo' || !$user_info['is_guest'])
  10. return $user_info['is_guest'];
  11.  
  12. echo '
  13. <form id="loginform" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '">
  14.  
  15. <label for="user">USERNAME</label>
  16. <input type="text" id="user" name="user" size="9" value="', $user_info['username'], '" class="input_text" />
  17.  
  18. <label for="passwrd">PASSWORD</label>
  19. <input type="password" name="passwrd" id="passwrd" size="9" class="input_password" />
  20. <!--
  21. <select name="cookielength">
  22. <option value="60">for 1 Hour</option>
  23. <option value="1440">for 1 Day</option>
  24. <option value="-1" selected="selected">until you log out</option>
  25. </select>
  26. -->
  27. ';

Et voila ! Now we only have our needed textfields.

So, what’s our status so far ? Users can login with their forum credentials and are automatically added to the wp_users table in the database.

From this point on you have 2 choices:

You continue to use this combination of blog and forum or start over with your freshly added users, who are now “imported” in wordpress.
I choosed the first.

 

In dit 2de deel gaan we verder door de audio te importeren in Virtualdub. Het eerste deel vind je hier terug.
2.2 Audio importeren

We kiezen voor “Audio -> Audio from other file…” en selecteren het aangemaakte mp3 bestand. In het daaropvolgende dialoogvenster selecteren we “Autodetect”.


Opgelet !

Het kan zijn dat je onderstaande melding krijgt:

 

 

 

 

 

In dat geval is er nog geen mp3 encoder geïnstalleerd.

We kiezen voor de Lame mp3 encoder, dewelke je op volgende manieren installeert:

Windows Xp

  1. Extract het zip bestand
  2. rechtsklik op het bestand LameACM.inf en selecteer installeren

Windows Vista/7

  1. Extract het zipbestand naar een locatie bv; C:\lame
  2. Zorg dat je een commandprompt als administrator start en geef het volgende in:

32bit:

rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 0 c:\lame\LameACM.inf

64bit:

C:\Windows\SysWOW64\rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 0 c:\lame\LameACM.inf


2.3 Video instellingen – filter

Nadat de audio in orde is gebracht moeten we nog een paar wijzigingen doen aan het beeld. We beginnen met een filter.

Kies “Video” en zorg dat “Full processing mode” aangeduid is, waarna de keuze “Filters” beschikbaar wordt.

Hier kiezen we voor de filter “Border-control. Je kan deze installeren door de het bestand BrdCntrl235.vdf afkomstig uit het vdfilterpack te plaatsen in de plugin folder van Virtualdub.

We stellen in dat de border aan al de kanten 10 pixels groot mag zijn. (Dit om eventuele ruis te bedekken).

Uiteraard kan je nog veel meer filters toepassen zoals ruisonderdrukking, verbeteren van analoge beelden, kleur, contrast enz. In dit gedeelte focus ik mij enkel op een basis gebruik van filters en compressie.

2.4  Video instellingen – compressie

We gaan verder met de volgende stap: klik op “Video – > Compression”, indien je x264vfw correct hebt geïnstalleerd dan zie je die in de lijst staan. Klik erop en kies “Configure” .

Een scherm met een aantal opties komt nu tevoorschijn, het eerste wat je doet is in het “Rate control” dropdown menu  kiezen voor “Multipass – 1st pass”

Multipass codering betekent dat de compressor meerdere keren kijkt naar de video, zodat het beter zou weten waar en wanneer er in je video een hogere of lagere bitrate toegewezen moet worden.

Bijvoorbeeld: een scène met veel beweging en intense actie zou  een hogere bitrate  vereisen  dan een donkere scene  met weinig aan de hand.  Tijdens de 1e pas zal de compressor aantekeningen maken en deze bevindingen in een. Stats-bestand plaatsen. Bij de de 2e poging zal de echte codering beginnen en aan de hand van het .stats bestand de bitrates goed zetten.

Over de bitrates: ik kies hier persoonlijk voor 2000.

De rest van de instellingen mag je zo overnemen. Bij een mouse-over van een element krijg je een woordje uitleg.

2.5 Alles aan het werk

Klik op “File -> Save as Avi

Geef een bestandsnaam op en wacht totdat de eerste pass (analyse) klaar is. Nadien ga je terug naar ” Video – > Compression ->  x264vfw -> Configure”.

Selecteer Multipass – N-pass (ook voor zorgen dat de stats file locatie overeenkomt met die van de 1ste pass) en vervolgens weer “File -> Save as Avi“.

3. Besluit

In slechts een paar stappen hebben we onze analoge video omgezet naar een digitaal formaat. Zoals meermaals gezegd kan je met allerhande filters de beeldkwaliteit van de video serieus verbeteren zodat het materiaal als nieuw lijkt. Voor meer informatie omtrent werken met filters verwijs ik graag naar www.doom9.org

 

Iedereen heeft ze nog wel liggen, de befaamde 8mm video cassettes, ofte Hi8 genoemd.

In dit eerste deel laat ik zien met welke software ik de analoge beelden opneem en  het geluid uit het videobestand extract voor wat aanpassingen.

Mijn eerste probleem was het materiaal dat ik ter beschikking had om dit te verwezenlijken. Mijn gebruikte sony camera (de  CCD-TR713E) beschikt enkel over een A/V uitgang, oftewel de bekende rood-wit-geel/zwarte tulp aansluitingen.

Om dit probleem te overbruggen schafte ik mij een Logilink aan dewelke mij toeliet om de camera te verbinden met de computer.

Gebruikte software

  1. Dscaler
  2. Virtualdub
  3. Virtualdub plugin: Bordercontrol
  4. x264vfw compressie plugin
  5. Audacity

 

Allereerst zorgen we ervoor dat onze werkomgeving klaargezet wordt.

We sluiten onze camera aan op de pc en zorgen dat het beeld zichtbaar wordt op het scherm.

1. Dscaler

Quote van Dscaler website:

The DScaler TV Viewing Application (also known as DScaler 4) is a piece of software that captures video, processes it, and scales it for presentation on a projector or computer monitor. DScaler implements highly sophisticated algorithms that work in real-time to provide PC owners with image quality matched only by very expensive equipment.

DScaler performs a variety of functions:

  • Grabbing video from a DVD player, game console, laserdisc, or VCR in a reliable fashion, in either analog or digital form
  • Deinterlacing video source, such as sports and news produced with a video camera, as well as console games
  • Detecting and removing 2:2 pulldown (PAL) and 3:2 pulldown (NTSC) for movies and filmed television programs
  • Reducing video noise on analog sources
  • Automatically calibrating video capture cards for optimal brightness, contrast and color
    Manipulating video through gamma, sharpness and other filters
  • Viewing still images
  • Reducing judder and other video timing anomalies
  • Presenting all of the above in the desired resolution and aspect ratio.

Na het opstarten van Dscaler controleren  we of onze video herkent wordt, alsook of de output goed staat. We kiezen hier voor PAL_B. Standaard kan het zijn dat dit op NTSC staat.

Dit doen we door in het menu “Sources – > gewenst device” aan te duiden

 

en bij “Dshow -> Video Standard -> Pal_B”
bij “Resolution -> 720×576”

Pal_B settings

We spelen nu onze video af en controleren of het beeld wel degelijk klopt. Nu moeten we alleen dit beeld nog zien te bewaren zodat het bewerkt kan worden in Virtualdub.

We doen dit als volgt:

In het menu “Actions -> Recording -> Options” stellen we in waar de video bewaard moet worden, alsook welke compressie etc toegepast wordt. We kiezen voor uncompressed.

Ook kiezen we van welke geluidsbron opgenomen moet worden.

Een beetje uitleg over de gebruikte instellingen.

Recording Format:  YUY2

Quote Virtualdub:

Two common YCbCr FOURCCs are UYVY and YUY2. They are interleaved, meaning that all YCbCr components are stored in one stream. Chroma (color) information is stored at half horizontal resolution compared to luma, with chroma samples located on top of the left luma sample of each pair; luma range is 16-235 and chroma range is 16-240. The formats are named after the byte order, so for UYVY it is U (Cb), Y (luma 1), V (Cr), Y (luma 2), whereas the luma and chroma bytes are swapped for YUY2 — Y/U/Y/V.

On Windows, it seems that YUY2 is the more common of the two formats — Avisynth and Huffyuv prefer it, the MPEG-1 decoder lists it first, etc. Most hardware is also capable of using both formats. Ordinarily I would consider supporting only YUY2, except that the Adaptec Gamebridge device I recently acquired only supports UYVY. Now, when working with these formats in regular CPU based code, the distinction between these formats is minimal, as permuting the indices is sufficient to accommodate both. (In VirtualDub, conversion between UYVY and YUY2 is lossless.) When working with vector units, however, the difference between them can become problematic.

Quote htforum.nl:

YUV comes in two basic flavors: packed and planar.

In packed the Y (brightness), U (aka: Cb = Chroma blue) and V (aka: Cr = Chroma red) samples are packed together into macropixels that are stored in a single array. Planar YUV formats store them in separate arrays. What about Chroma green? That’s calculated from the Y, U and V channels.

Both YUY2 and UYVY are packed YUV formats and are most often both available in codecs that use either. The main difference is that YUY2 has a slightly different component ordering within the UY_INT32 macropixel.

Both also use a 4:2:2 “colorspace”, meaning that in a 720 wide frame there are 720 brightness samples and 360 color samples, with Cr and Cb being spread across each pair of horizontal pixels. The vertical pixels are all at full resolution. These sample spacings are called the fourCC’s “sample periods” and they are given for each sample in both the horizontal and vertical planes.

This basically means that the B&W samples are at the frames full resolution while the color samples are spread across 2 horizontal pixels. Since the eye is more sentitive to B&W than color this cuts the video data rate with little visible loss while maintaining a high level of “edit-ability”.

In terms of MPEG encoders UYVY is the second most popular YUV format used after YV12, but they don’t use 4:2:2 as an output colorspace. 4:2:0 is the order of the day for that, but how that’s organized is a whole other post.

Bottom line: there is very little, if any, practical difference between the two.

Aangezien de meeste videobewerking via YUV zal gebeuren, kiezen we voor dit formaat om zo weinig mogelijk te verliezen bij een bewerking. Ook zorgen we voor geen compressie om zo “raw” mogelijke data verkrijgen.

Voor de video resolutie zijn er 2 gewenste mogelijkheden:

  1. 720×576 25fps in PAL of
  2. 720×480 29.97fps in NTSC formaat.

We kiezen voor het dvd formaat van 720×576 en sluiten de instellingen af.

Nadien drukken we op play op de camera en zorgen via de toetscombinatie “Shift-R”  dat de opname opgenomen wordt.

Na een poosje krijgen we het videobestand dat de volgende eigenschappen heeft volgens MediaInfo:

General
Complete name                    : ds000.avi
Format                           : AVI
Format/Info                      : Audio Video Interleave
Format profile                   : OpenDML
File size                        : 117 GiB
Duration                         : 1h 40mn
Overall bit rate                 : 167 Mbps
 
Video
ID                               : 0
Format                           : YUV
Codec ID                         : YUY2
Codec ID/Info                    : YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel
Duration                         : 1h 40mn
Bit rate                         : 166 Mbps
Width                            : 720 pixels
Height                           : 576 pixels
Display aspect ratio             : 5:4
Frame rate                       : 25.000 fps
Standard                         : PAL
Color space                      : YUV
Chroma subsampling               : 4:2:2
Compression mode                 : Lossless
Bits/(Pixel*Frame)               : 16.000
Stream size                      : 116 GiB (99%)
 
Audio
ID                               : 1
Format                           : PCM
Format settings, Endianness      : Little
Format settings, Sign            : Signed
Codec ID                         : 1
Codec ID/Hint                    : Microsoft
Duration                         : 1h 40mn
Bit rate mode                    : Constant
Bit rate                         : 1 536 Kbps
Channel(s)                       : 2 channels
Sampling rate                    : 48.0 KHz
Bit depth                        : 16 bits
Stream size                      : 1.08 GiB (1%)
Interleave, duration             : 1000 ms (25.00 video frames)

Merk op dat bij Audio er 2 channels zijn, later in Audacity zul je zien dat er slecht 1 audio kanaal is (het rechtse), terwijl het linkse gewoon lichte ruis bevat.

2. Virtualdub

Quote van virtualdub site:

VirtualDub is a video capture/processing utility for 32-bit and 64-bit Windows platforms (98/ME/NT4/2000/XP/Vista/7), licensed under the GNU General Public License (GPL). It lacks the editing power of a general-purpose editor such as Adobe Premiere, but is streamlined for fast linear operations over video. It has batch-processing capabilities for processing large numbers of files and can be extended with third-party video filters. VirtualDub is mainly geared toward processing AVI files, although it can read (not write) MPEG-1 and also handle sets of BMP images.

Dmv van Virtualdub kunnen we de video inladen en bewerkingen doen zoals knippen, geluid extracten, filters toepassen en compressie.

Virtualdub gebruik ik hier voor 2 bewerkingen:

  1. – audio extracten en bewerken met audacity om een stereo spoor te creëren
  2. – borderplugin en compressie toepassen

2.1 Audio extracten

Via “File -> Open video file”  en “File -> Save wave…” gaan we onze audio scheiden van de video en importeren in Audacity.

Wanneer dit bestand geïmporteerd is dan merken we dat er wel een stereospoor aanwezig, maar enkel langs 1 kanaal. Dit gaan we dus aanpassen.

We klikken op het pijltje naast “Dscaler – “ en kiezen voor “Stereospoor splitsen”. We kunnen dan het bovenste kanaal apart selecteren en verwijderen. (Merk op dat er nu een gele kader getrokken wordt tussen de 2 kanalen)


Het onderste spoor  kopiëren we naar het bovenste zodat een “stereo” effect ontstaat. Uiteraard kunnen we nog een aantal dingen aanpassen zoals het volume, ruis weghalen enz, maar dat is nu niet van toepassing.


Nadat dit in orde is gebracht, bewaren we het bestand als een .mp3; kwestie om de bestandsgrootte wat in te perken, via “Bestand -> Exporteren..” 

Deze file gaan we nadien in Virtualdub terug importeren in het bestaande videobestand. (Zie Deel 2 )

 

We are giving away a <$random-product> for our followers. Please RT to have a chance. Winner by 5 pm #hastag_of_company @profile_of_company

Thnx for your message @Ceeke, we’ll provide the necessary information asap.

Looks familiar ?

A company nowadays is looking for new ways to attract costumers or to promote their products. With the use of social media like Twitter, Facebook, Myspace, Friendster etc they can reach a greater public than ever imagined, with less costs for themselves.

After all, if one user does a re-tweet it has an exponential change to reach thousands of people, only with the power of a 140-character message, creating a micro business model.

This model has a few advantages compared to the “early days” like:

  1. fewer costs
  2. direct contact with your costumers
  3. create a “we are here” feeling

However advertising alone won’t do the trick.

Promoted tweets, as they are called, are no silver bullet. Tweeting in such matter needs to be with a certain coordination and sustained, value-driven engagement so that the message will be amplified, otherwise it is bound to fail.

Also creating value-driven twitter adds is something corporate marketeers need to take  upon themselves.
Advertisers need to sit down and think about how content is used, shared on Twitter and, importantly, what makes a Tweet successful.

But does Twitter advertisement really work ? It sure did for Dell.

In 2007 Dell launched the @DellOutlet account using it to sell refurbished systems. As of today it has more than 1.500.000 followers and sales where surpassed by $3 million. More than $2 million came from sales directly attributed to Twitter and another $1 million from people who start at Twitter and then move on to buy a new computer somewhere else on the Dell Web site.

But not only companies can profit from this piece of technology, people like you and me can do likewise .  Take for example (starting) bands who give away free tickets, creating sympathy by the Twitter users.

Oh and yes, if you like this article, please RT 😉

 

A new surprise rose when working on a mac today.

When copying a folder to a location where a folder with the same name already exists, the only option is to replace the folder (and loosing all files from the replaced folder) or stop the copy/move operation.

1) We create the following folder structure:

2) We copy/move “Data” from the rootfolder to “Main” and receive a notification about an excisting item.

3) If your windows-minded, like me, you’ll assume that existing files/folders will be renamed/merged. Guess again.

4) Our “Main -> Data” folder is fully replaced with the Data folder from our root, which means that everything is removed.

I guess a simple merge option is not user-friendly….
sidenote: Assumption is the mother of all fuck up’s

 

A (beta) version of Messenger live is available.

Download Windows Live Messenger 2011:

http://explore.live.com/windows-live-messenger

On a side note:

The new Windows Live Messenger, differently from previous WLM versions, doesn’t give you the opportunity to modify and alter your nickname or display name . What’s worst is that Windows Live Messenger 2011 will only display your real name and surname which you previously set in your profile when you signed-up. Let’s see together how you can easily modify and add your nickname thanks to this little trick!
The only way to add a nickname to Windows Live Messenger 2011 is to modify your real name and last name. No other ways are possible at this time.

  • Open and login Windows Live Messenger 2011.
  • Click your user name using the small arrow on top of the messenger’s window.
  • Click Edit your Name in the menu.
  • A Windows Live Profile web page will be automatically opened in your browser. Modify or change the First Name and Last Name.
  • Click the Save button.
  • Done!
 

This little script helps to locate a (cisco) switch which has multiple connections on one port.
The result is a txtfile with the name, ip and port of the switch.

Software used:

  1. cut.exe
  2. sort.exe
  3. uniqe.exe
  4. tst10.exe aka Telnet Scripting Tool

The first 3 files can found in the CoreUtils archive.

The Telnet Scripting Tool can be found on Jerry Mannel’s blog

Preparations:

  1. Create a folder and place the files
  2. Create a file, eg switches.txt
  3. Save the source code, which can be found at the bottom of this article, as something.vbs

– Switches.txt should be in the following format:

ip-address;serietype;fullname (in most cases serietype=2950)

10.10.10.1;2950;switch-01
10.10.10.2;2950;switch-02

To run: open a commandprompt and type “wscript something.vbs”

The Code:

We begin by setting up our environment.

set wshshell = createobject("wscript.shell")
set fso= createobject("scripting.filesystemobject")
set switchlist = fso.opentextfile("switches.txt")
 
if fso.fileExists("result.txt") then
	fso.deleteFile "result.txt", true
end if
 
set result = fso.openTextFile("result.txt",8,true)

We loop switches.txt until all items are processed and make sure that previous created files are removed.

do until switchlist.atendofstream
 
	'--- Remove all previous files ---
 
	if fso.fileExists("output.txt") then
		fso.deleteFile "output.txt", true
	end if
	if fso.fileExists("temp.txt") then
		fso.deleteFile "temp.txt", true
	end if
	if fso.fileExists("double.txt") then
		fso.deleteFile "double.txt", true
	end if
 
	switch = switchList.readLine
	matrix = split(switch, ";")
	ip = matrix(0)
	typeswitch = matrix(1)
	switchname = matrix(2)
 
	if fso.filEexists("script.txt") then
		fso.deleteFile "script.txt", true
	end if

Since not every IOS uses the same commands, we split our code up.

if typeswitch = "2950" then
 
	set script = fso.openTextFile("script.txt",8,true)
		script.writeline ip & " 23"
		script.writeline "send " & """<passwd>\m"""
		script.writeline "wait " & """>"""
		script.writeline "send " & """term len 0\m"""
		script.writeline "wait " & """>"""
		script.writeline "send " & """show mac-address-table | include Fa0/\m"""
		script.writeline "wait " & """>"""
		script.writeline "send " & """quit\m"""
	script.close
 
	else 'type=2948
 
	set script = fso.openTextFile("script.txt",8,true)
		script.writeline ip & " 23"
		script.writeline "send " & """<passwd>\m"""
		script.writeline "wait " & """>"""
		script.writeline "send " & """set len 0\m"""
		script.writeline "wait " & """>"""
		script.writeline "send " & """show cam dyn | exclude 2/49\m"""
		script.writeline "wait " & """>"""
		script.writeline "send " & """quit\m"""
	script.close
 
	end if

The code above is necessary for using the Telnet Scripting Tool. More information about its use can be found on this blog.

commandoTelnet = "TST10 /r:script.txt /o:output.txt"
	wshshell.run commandoTelnet, ,True	
 
	wscript.sleep 3000
 
	if typeswitch = "2950" then
 
	commandoGrep = "cmd /c " & """grep -e " & """DYNAMIC""" & " -e " & """STATIC""" & " output.txt > temp.txt"""
	wshshell.run commandoGrep, , True
 
	commandoCut = "cmd /c " & """cut -c 39- temp.txt > test.txt"""
	wshshell.run commandoCut, , True
 
	else '=2948
 
	commandoGrep = "cmd /c " & """grep -e " & """[ALL]""" & " output.txt > temp.txt"""
	wshshell.run commandoGrep, , True
 
	commandoCut = "cmd /c " & """cut -c 39- temp.txt > test.txt"""
	wshshell.run commandoCut, , True
 
	end if
 
	commandoFindDuplicates = "cmd /c" & """sort test.txt |uniq -d > double.txt"""
	doubles = wshshell.run(commandoFindDuplicates, ,True)
 
	if fso.fileExists("double.txt") then
		set readDoubleTxt = fso.openTextFile("double.txt")
		do until readDoubleTxt.atendofstream
			routerOpPort = readDoubleTxt.readline
			result.writeline switchname & "(" & ip & ")" & "->" & routerOpPort
		loop
	readDoubleTxt.close
	end if
 
loop
result.close
Wscript.Echo "Script finished !"

The resulting output is:

switch-02(10.10.10.1)->Fa0/45
switch-02(10.10.10.2)->Fa0/46
switch-03(10.10.10.3)->Fa0/2
switch-06(10.10.10.4)->Fa0/33
switch-07(10.10.10.5)->Fa0/41
switch-08(10.10.10.6)->Fa0/24

Although this script can be further optimized, it does the job for me 🙂

The fullcode :


 

When receiving popups as mentioned above, your not really infected, that is if you don’t put a fake antivirus program in account.

Quote from Wikipedia:

Security Tool is a rogue antivirus program that displays false scan reports intended to convince the user that his or her computer is infected with various forms of malware. This misleading software will tell the user that he or she needs to purchase the full version of the software to remove these threats. These so-called infections do not actually exist, however, as they are only attempts to frighten the user to purchase the full version of the software. This rogue is designed to scam the operator into giving the fake purchase panel their credit card number and information.

In other words: Security Tool displays fake security alerts. Once running, Security Tool will scan the computer and randomly select various files and labels them as malware. Also it blocks the ability to run legit programs.

1. How to remove ?

By using a combination of the following software:
Malwarebytes Anti Malware – Superantispyware

  1. Boot to Safe Mode with network (press F8 while rebooting.)
  2. Install Malwarebytes Anti Malware and do an update.
  3. Install  Superantispyware, you can use the portable edition which does NOT install anything on your Start Menu or Program Files and does NOT need to be uninstalled.
  4. After Malwarebytes has been updated, let it do a full scan.
  5. When the scan is complete, click OK, then “Show Results” to view the results. Check everything and click “Remove Selected”. Reboot if prompted.

To make sure your computer is completely clean, do another scan with Superantispyware, using the latest version and definitions.

2. How to avoid ?

It’s one good thing on how to remove rogue programs, but it would be far better if these can be avoided in the future.

  1. Make sure you have an updated virusscanner.
  2. Verify your sources when downloading updates, software, etc
  3. Use common sense; e.g. don’t click on everything that seems legit
 

With these hot temperatures lately (+30°c); this could come in handy.

otherwise you can build your own fan:

 

Recently Google has changed it’s layout: bigger font and buttons, but also a “handy” toolbar which allows you to switch between the different Google options.

A few ways to hide this toolbar are:

Quote from: http://userscripts.org/scripts/show/76243

Creates a button below Google search bar to make possible show and hide this annoying left sidebar in Google search results. Script tested with Firefox 3.6, Google Chrome 5.0.396.0 dev and Opera 10.53. It remembers last user’s choice.

Installing:

Firefox: just click Install (need Greasemonkey extension installed https://addons.mozilla.org/ru/firefox/addon/748)

Chrome: just click Install

Opera:
1. Download script to a directory of your choice, i.e. C:\Program Files\Opera\Scripts.
2. Open Opera, and go to Tools->Preferences.
3. Click on the “Advanced” tab and select “Content”.
4. Now click “JavaScript Options…” and set “User JavaScript files” to the directory you chose before.
5. Restart browser

© 2012 Ceekes boarderline Suffusion theme by Sayontan Sinha