Skip to main content

Posts

Recent posts

Linux copy files and change date or time

So, you want to copy files from one folder to another folder and change both the source and destination timestamp?
Linux can easily change or modify the timestamp with ‘touch’ command.
A one liner command with the help of ‘pipe’ to pass the arguments and ‘xargs’ to execute multiple commands in a single line can easily accomplish this task.
Command below will copy the files in the current directory where ‘ls’ command is executed to the directory ‘xfiles’, timestamp will be changed to 7 hours less from the current time.
ls | xargs -I % sh -c 'touch -d "7 hours ago" %; cp -p % ./xfiles';
-p option is important to preserve the modified timestamp
Note: the above command will change the timestamp for both source files and destination files.
Command below will change the source timestamp, but the destination timestamp will be the date and time that the command was executed.
ls | xargs -I % sh -c 'touch -d "2 Aug" %; cp % ./x';

Notice, that the -p option is omitted …

WSUS – quick installation guide

WSUS or Windows Server Update Services is patching system for Windows OSes and other Microsoft products.
In Windows 2016 or another version of Windows server it’s quite straight forward to install or config ure WSUS. Make sure the server has enough memory and has sufficient space to download and store updates.
Plan accordingly the computer groups in WSUS, like 1 group for Testing updates and 1 group for production or other methods or strategy that is right for the environment.
Configuring WSUS should be straight forward but in some instances, it may not work right after installing the WSUS server role.
First, install and configure WSUS server role.
Second, configure GPO to point to WSUS server. If the clients will not know where to find or report to a WSUS server then WSUS sever will be empty. WSUS server will not be able to detect client or server devices.
In GPO you need to set the settings of how you are going to carry out the updates, like the time to install the updates, and a notific…

How to open an elevated command prompt from a standard account?

Working in a fast pace environment, will need to get things done quickly to do other tasks that needs to be done also.
Opening a command prompt in a standard user account without signing off and without logging off is possible with the “runas” utility command in Windows environment.
Open the run box and type “cmd”, to open the command prompt window.
Then type:
Runas /user:admin_account cmd
It will ask for a password, if authentication is valid then a new command prompt window will open in an elevated mode. Command works from Windows 7+  version.
That’s it, you just open an elevated command prompt window in a user standard account. Since most users are hungry with the admin password, just watch out with the shoulder sniffing tactic.

Other useful admin commands in a windows environment:
If ever you have a custom local admin account name and you can’t remember, type: net users
It will display all the local user accounts.
To check domain name and current login user account name, type:
Who…

Ping IPv4 or IPv6 in Windows 10

Windows 7 and newer releases of Windows supports ping results of either IPv4 or IPv6.

If the remote PC or server is configured for both IPv4 and IPv6, and if you need to ping via hostname and you want to get an IPv4 address type the command below:

ping -4 -n 2 Dhoney_Srv

Output will be IPv4 address of the hostname

ping -6 -n 2 Dhoney_Srv

Output will be IPv6 address of the hostname.

-n 2 send two ICMP packet requests.


Cheers! Till next time.


================================ Free Android Apps:
Click  links below to find out more:
Excel Keyboard guide:
https://play.google.com/store/apps/details?id=chrisjoms.myexcelapplicationguide
Linux Android App cheat sheet: https://play.google.com/store/apps/details?id=com.LinuxMobileKit
Heaven's Dew Fall  Prayer app for Android :
https://play.google.com/store/apps/details?id=soulrefresh.beautiful.prayer
Catholic Rosary Guide  for Android:
https://play.google.com/store/apps/details?id=com.myrosaryapp
http://quickbytesstuff.blogspot.sg/2014/09/how-to-recite-rosary.h…

Activate Windows from command line

How to activate Windows from command line?
If you have decided to convert an evaluation Windows server (Windows 2016 or other server version), or Windows 10 to a license Operating system then you need to replace the product key. You will need to change the product key and activate the system, in order to use the product outside of its evaluation period.
Assuming you have done the steps of converting the evaluation software and all the evaluation packages has been removed. Of course, if you have plenty of time in your hands and you just want to redo everything then you can just install or setup a new environment.
To activate a new product key from command line, first the product key must be installed and replaced the existing one. Second, activate the product key.
Here’s how to do it via command line:
a. slmgr /ipk windows-product-key-with-slashes
/ipk = installed product key windows-product-key-with-slashes – replace this with the actual windows product key
If everything goes well there will b…

How to search for string in Excel

There’s quite a lot of ways to do this in Excel, using Macro or Excel formula will be able to get the desired output.
Macro I think is good if the number of rows is not so large, but if the number of rows is quite large then a buffer overflow error might occur.
Formula can take quite large of data and able to deliver the result as expected.
ISNUMBER is a function that can check whether value is a number or not, the function itself tells what the formula will be doing.
Adding a search function to ISNUMBER then it can be used to search for a string with in a cell or the specified range in the formula.
Example below shows how ISNUMBER can be used to search for a specified string whether it exists or not. The position of the string doesn’t matter as long as the string exist within the cell, the formula will return TRUE, otherwise it will return FALSE if the string does not exist.
Here’s the example:
=ISNUMBER(SEARCH("search string", A5))
The “search string” is the string that will be se…