Skip to main content

Posts

Showing posts from April, 2016

List all IP Addresses of a server

Multi-homed server, a server with multi-services and is set with different IPs is quite common if there is a budget constraint. It is always good to have a dedicated server do a single function provided there is enough luxury to do it. So if you just inherited the network and all the servers in your environment have documentation which is poor to nothing, then pray hard that nothing will happen until you have it under control by proper documentation and familiarization. It's quite tough to troubleshoot when a problem arises if no proper documentation to depend on and there will be a lot of surprises as the work journey goes on. Listing or getting the IP Addresses on your entire server and having a proper documentation will definitely help and ease the tension during some issues. It’s also easy to troubleshoot during a network outage or other circumstances that may arise. Listing the IP Address of a server can be done in different ways. Doing it rem...

PowerShell Create Zip file and Extract Zip File

Create Zip File: $source1="D:\core2\south2" $destination1="D:\c2\zipfile.zip" #filename is important with ".zip" extension Add-Type -assembly "system.io.compression.filesystem" [io.compression.zipfile]::CreateFromDirectory($Source1, $destination1) Extract Zip File: $source2="D:\core2\zipfile.zip" #zipfile.zip file to be extracted $destination2="D:\core2\south1" Add-Type -assembly "system.io.compression.filesystem" [io.compression.zipfile]::ExtractToDirectory($Source2, $destination2) MSDN Reference: https://msdn.microsoft.com/en-us/library/system.io.compression.zipfile(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1 =========================================== Linux Android App cheat sheet: https://play.google.com/store/apps/details?id=com.LinuxMobileKit Free Android Apps: Click on links below to find out more: https://play.google.com/store/apps/details?id=soulrefresh.beautiful.praye...

Linux copy or backup files to remote machine

Copying or backing up files to the remote machine is a good practice if hard disk space is not a concern. Having a backup on the same machine is like the old saying "putting eggs in one basket". Backing up data on another machine would simply eradicate the worries of losing data provided that the backup is really a backup. Backup should be tested as often as possible. Backup is for disaster recovery and it should be able to cover the disaster and not add a burden. In Linux "tar" is a good old tool which does a pretty awesome job to backup or copy files. TAR - tape archiver, as the name implies it is designed for tape backup. To automate backup using “cron” scheduler, "tar" is a good choice since it will only require the 'user name', 'remote machine IP address or hostname' and the path on the remote machine where the file should be copied. Once the above requirements are known, tar will be able to copy to t...

Windows delete files in all directories

Deleting files are good and bad. It is good to delete files because it will tidy up your computer, get rid of unwanted or outdated files and free up space on the drive. It is bad to delete file or files if no backup is available and the data is of great importance. So deleting files should be done carefully and cautiously to make sure that deleted data will not be needed anymore. How to delete files automatically in all folders and subfolders? The batch file will come handy to automate file deletion. Below is an example that deletes files on the temp folder for any “dll” files. This can be applied to any folder path but don't do this on the c:\windows folder or the system will be completely unusable. Open a command prompt and copy and paste the commands below or save it to notepad and run the script as a batch file. C:\Users\\AppData\Local\Temp>FOR /f "tokens=*" %a in ('dir *.dll   /B /S') DO del %a Above command ...

Linux copy or move files with xargs

Copying or moving files via terminal or command line are quite easy and basic. Working remotely in Linux can be done by typing via terminal and executing commands. Typing the same commands all over again is not quite practical, so a lazy admin comes into play. Lazy admin doesn't literally mean a lazy admin, but a guy who likes to automate things by using his knowledge and skills like scripting. Crontab in Linux is a scheduler to automate and run scripts at a specified time. Crontab is powerful if the script and the settings are configured properly; it will do the task without user intervention. Some basic commands below to move or copy files and pipe to "xargs" command. By typing: ls *.log this will filter the output for files with ".log" extension.      ls *.log | mv $(xargs) /path/another_folder Move Recursively:     find  /path/log_folder/ -type f -name '*.log' | mv  $(xargs) /path/another_fold...

Windows update keep installing on shutdown

Ever have an issue that windows update keep installing on shutdown all over again. It keeps installing on shutdown but updates never get installed, the next time you shutdown still the same update is applied. There are quite a few solutions on the web on how to get rid of this issue. But whatever solution or suggestion on the web that you can find, don't and don't install third party software claiming to solve the issue. Below is the link which I found to be helpful to solve this kind of issue: http://answers.microsoft.com/en-us/windows/forum/all/windows-7-update-fails-with-code-80070308/f5b42dbc-3776-4051-beb2-f4d211bb0681?auth=1 The link is answers.microsoft.com, so I guess it can be trusted. But don't just follow or believe any instruction from a public forum. I know you are asking for help. What I mean is try to evaluate whether the instruction or solution given by other people is reliable and not causing any further harm or iss...