Posts

how to automate Serial/Telnet/ssh Login Using TTL

This is a simple ttl script which is used to automate the login in serial/ssh/telnet To know more about ttl : https://vaneeswarann.blogspot.in/2018/02/how-to-write-a-simple-ttl-script.html ;------------------------------------------------------------------------ ; Developed By : ; Vaneeswaran N ; www . vaneeswaran . com ;------------------------------------------------------------------------ connect '/C=10' ; connect to com port 10 UsernamePrompt = 'login:' ; setting username prompt Username = 'root' ; variable to hold the username value PasswordPrompt = ' ' ; setting username prompt Password = 'admin@123' ; variable to hold the password ; running an infinite while loop so whenever login reboot happens it will b automatically logged in while 1 wait UsernamePrompt ; waiting for the userpromt sendln Username ; feeding the username once prompts wait PasswordPrompt ...

How to write a simple ttl script macro

Image
Tera Term is an open source terminal which is similar to putty. It supports a Script Language called " Tera Term Language " or " macro " which can be used to automate the CLI based user action. Using this script we can do a lot of automation. The beauty of this script are that these script will be running in host computer and commands are executed on the target.Which means even the target goes for reboot the scipt will be still running and even we can capture/ automate certain tasks which involves reboot.Also no matter whatever the target we can develop script as these scripts are running in the hosts (windows). Advantages over other scripting language; Target Platform Independent Able to continue to run even after reboot Changes in the target is not required Supported over serial,ssh,telnet connections. Executing a TTL Script   How to Use it: Establish a serial/telnet/ssh connection by setting up the baud rates.  Launch the ttl script by going t...

Creating Junk File in Unix

How to create Junk file in Unix Generally Junk files are created for testing the application developed and so on. Here I have show four methods to create Junk files in Unix: Method 1: using dd   dd if = /dev/zero of = filename.txt count = 1024 bs = 1024 bs--> Block Size. [1024 *1024 = 1MB file will be created] (or) dd if = /dev/zero of = filename.txt count = 1M bs = 1024  (1MB *1024=1GB file will be created) dd essentially copy that force to write every block of data (data will be unreadable but return 0) Method 2:  using  truncate truncate –S 10G file.txt It create a “sparse file” that cheats the file system and says that its has 10GB of data ,in other words it create a virtual data.This is fastest method for creating junk file. Method 3:  using  fallocate  fallocate –L 10 G file.txt It will allocate a 10 GB in memory in disk (not sparse file) but we will not have to worry about the data, which means a...

How to Create Folder Lock in windows

Create Your Own Folder Lock Step  1: Go to the folder where you wanna create a Your Own Folder Lock Step 2: Open a notepad and copy the given Code cls @ ECHO OFF title Folder Personal if EXIST "HTG Locker" goto UNLOCK if NOT EXIST Personal goto MDLOCKER :CONFIRM echo Enabling Lock ::Waiting for Conformation (y/n) set /p "cho=>" if %cho% == Y goto LOCK if %cho% == y goto LOCK if %cho% == n goto END if %cho% == N goto END echo Invalid choice . goto CONFIRM :LOCK ren Private "HTG Locker" attrib +h +s "HTG Locker" echo Folder locked goto End :UNLOCK echo Enter password to unlock folder set /p "pass=>" if NOT %pass% == mypassword goto FAIL attrib -h -s "HTG Locker" ren "HTG Locker" Personal echo ERR_INCORRECT_PASSWORD ::FOLDER UNLOCK FAILED goto End :FAIL echo Invalid password goto end :MDLOCKER md Personal echo Fo...

Touch command in powershell

The following power shell program is the similar to the Touch Command in Unix. It has the following features. create new file modify time stamp <#Read Me: Developed By: Name:Vaneeswaran N www.vaneeswaran.com #> $Function_Exit_Status = $false #Variable to store the exit status of the function function Touch_File ( $filename ) { $global:Function_Exit_Status = $false if (! [System.IO.File] ::Exists( $filename )) { echo "" > $filename $global:Function_Exit_Status = $true } else { $update = get-date try { Set-ItemProperty -Path $filename -Name LastWriteTime -Value $update $global:Function_Exit_Status = $true } catch { Log_Exception $( $_ .Exception.GetType().FullName) $( $_ .Exception.Message) $global:Function_Exit_Status = $false ...

Logger in Powershell

The below functions can be used as Logger and Exception Logger in power shell. The Logger function can be used to log the message in a file The Log_Exception function can be used to log the exception thrown at any try{} .. catch{} statements. The Test_Exception function is a driver function  < #Read Me: Developed By: Name:Vaneeswaran N www.vaneeswaran.com #> $Function_Exit_Status = $false #Variable to store the exit status of the function function Logger ($Log_Message , $Log_File) { try { $log_str = "$(Get-Date -format " yyyy MMM d hh:mm:ss ") $Log_Message " echo $log_str >> $Log_File } catch { write-host “ Caught an exception: ” -ForegroundColor Red write-host “ Exception Type: $ ($_.Exception. GetType ().FullName) ” -ForegroundColor Red write-host “ Exception Message: $ ($_.Exception.Message) ” ...

Online Unix Server for Free

Image
 Do you wanna work on Unix Platform ?    (with Internet)         No need of installing an Unix OS just follow the instruction below. Step 1: Ensure that Telnet is Enabled in your machine(If u dont know just visit the link)                To Install Telnet in your system click here Step 2: Go to linuxzoo.net Step 3: Create an account  Step 4:After that login with your email and password Step 5:Now click on Join queue Step 6: Click on "switch on" tab and wait for the boot progress to become complete Step 7:Now under connect Click on URL Telnet and a popup will appear (Ensure that popup are enabled in your browser) Step 8:Now Launch the application a telnet prompt will be opened              Login: root             Password: secure If u have any doubts watch this video Thats all now u can...