Skip to main content

Posts

Windows 7 black screen after windows logo

Windows 7 just show a black screen, after showing the windows logo on startup. On Windows startup with the black screen, try pressing caps lock key. If caps lock key respond normally, then there’s a chance that windows boot up properly. Press the power button for 3 seconds and release it. If windows shutdown properly, turn on the computer again. This time, try pressing F8 to go to safe mode. In safe mode, open device manager. Open windows explorer, right click on “This Computer” or “My Computer” and select properties, this will open device manager.  Or alternatively, go to control panel and select device manager. In Device Manager, select the Display Adapter, right click on it and click properties. From the properties, uninstall the driver. Don’t worry windows will install its standard or default display driver. Restart or shutdown the computer, if the problem is just the corrupted display driver then startup should be working  fine and the black screen iss...

Copy folder/file to multiple folders

Copy a single folder to multiple folders? Copy a file to multiple folders? This can be done easily using PowerShell script. Script below requires PS 3.0, but it can easily be tweak for other version. Here's the script: #++++++++++++++++++++++++++++++ $source_folder="D:\xfolder\United Folders" dir -Directory "D:\Unity\Project_016\" | ForEach-Object { write-host $_.fullname Copy-Item -Path $source_folder -Destination $_.FullName } #++++++++++++++++++++++++++++++ What the script does is the $source_folder is to be copied to all folders in the destination. Basically, the "United Folders" is to be copied to the root of the sub folder in destination folder which is "D:\Unity\Project_016\". Example: D:\Unity\Project_016\01 D:\Unity\Project_016\02 D:\Unity\Project_016\03 After executing the script, the folders will look like this: D:\Unity\Project_016\01\United Folders D:\Unity\Project_016\02\United Folders D:\Unity\Project...

Excel formula fixed cell address

How to insert a formula with a fixed cell address? Absolute referencing will come to the rescue. Absolute reference in Excel is prefix with a dollar ($) sign. $A$1: This means that Column "A" and Row "1" will not change when copied to another cell. Example:       =SUM(A$1,$A2,$A$1) The above formula when copied from one cell to another cell, $A$1 will remain the same. While A$1,$A2 will change its location when copied to another cell.  A$1: This means that column "A" will change while row location (which is number 1) will not change when copied.  So this absolute reference will change like D$1, G$1 or E$1 depends on the location. So number "1" value will never change.  $A1: The column "A" will not change when copied from one cell to another cell, while the row value which is number "1" will change. So the above absolute reference will change like $A3, $A10, $A12 etc., Column "A" will be const...

Hide files in Linux

To easily hide files in Linux prepend the file or directory with a dot "." before its filename or directory name. To view hidden files in Linux use ls -la command. Hidden files in Linux are prepended with "." (dot). To hide a file, use the mv (move) command. mv command will rename the file or directory, if another path is specified aside from the current directory then the file is moved and at the same time it will be renamed, if a new file name is specified. Here's one example: mv hide_salary.txt .hide_salary.txt hide_salary.txt will be renamed to .hide_salary.txt Hiding files does not mean restricting access. It will only hide the file from the user. Proper permissions settings should be defined if restriction is needed. ls -l command will not show hidden files. ls -la command will show hidden files. To unhide the file simply remove the "dot". Unhide a hidden file: mv .hide_salary.txt show_salary.txt ...

Linux protect file from deletion

To protect file from deletion in Linux system, the chattr command is able to set the attributes that protects the file. chattr +a my_protected_file.txt chattr +a  == means that the file can be appended and the file can't be deleted as well. To set the file to immutable, "+i"  attribute can be used. chattr +i the_protected_file.txt Immutable file is protected from deletion and the original contents of the file is also preserved because no changes can be made. This command below: ls xx*.txt >> the_protected_file.txt The command above will show "permission denied" if the file is immutable. If the file is set with +a, then the above command will append the output of "ls" to the file. To unset or removed the attribute use the minus sign, "-a", "-i". For example, chattr -a the_protected_file.txt or  chattr -i the_protected_file.txt To know more about chattr type the command below: man chattr chattr --help...

Folder redirection very slow

Folder redirection is good and bad, well if everything is working as expected then it's definitely good and sometimes it's bad if it causes some unexpected issues such as very slow login. So you have a folder redirection working  smoothly over the years, users can always change their password whenever they want it and of course, System Administrator can also change user password anytime whenever they want it or whenever they just felt like changing it (just kidding), or when situations demand it. If folder redirection suddenly becomes problematic or causes some issue such as slow login, one issue could be that the user changes the password or the Sys Ad change the user password. One issue I encountered if the folder redirection suddenly becomes slow, if the client or the user has a mapped drive that is set manually and set to persistent, persistent mapped drives uses the Vault Credential Manager to store the password. If the password is not updated in the vau...

Map drive not working

Mapping drive can be set in different ways,  via group policy, using scripting (PowerShell, Vbscript, Jscript) or it can be set via command line. Setting script via command line can be done easily using ”net” command, like the example below. The example below shows the syntax on how to map a drive or folder. net use ? The syntax of this command is: NET USE [devicename | *] [\\computername\sharename[\volume] [password | *]]         [/USER:[domainname\]username]         [/USER:[dotted domain name\]username]         [/USER:[username@dotted domain name]         [/SMARTCARD]         [/SAVECRED]         [[/DELETE] | [/PERSISTENT:{YES | NO}]] NET USE {devicename | *} [password | *] /HOME NET USE [/PERSISTENT:{YES | NO}] Example: N...

Linux search string in text files

Search a string or a pattern in text files without opening the file. Grep is a handy tool to find or search a string in text files. Grep is an available tool in Linux and Unix OSes. So if you have some data or information stored in text files and forget where the file is located. As long as you know the keyword or a string to search for, then grep and find command will be your utmost friend. "Grep" and "find" are tools to make life easier to get the information you want but how to use it? Command below will search recursively in the patch specified for all the text files and display the file where the match is found, output will also include the path and the filename. find /home/00_Notes -name '*.txt' -print0 | xargs -0r grep -H 'vanity baseline' The xargs -0r,  is zero r. The above command will search recursively in all folders and subfolders for text files which contains the string "vanity baseline". If a match is ...