Tag Archive
3D 3dprinting android ant BigData bitcoin Browsers C/C++ cryptocurrency CSS dd ddrescue dogecoin DOS editors find Games Git hadoop html html5 Java Linux litecoin node perl Postgres Programming Python scripting Shell SQL Swing TOTK Utilities utilization vi Video Web Web Design Wifi Windows Wordpress XML Zelda
Windows 10 Screen Rotation
I was recently trying to read a large log file and I needed to rotate my screen to portrait mode in order to read more text. Sadly, I learned that the CTRL+ALT+<LEFT ARROW> and CTRL+ALT+<RIGHT ARROW> key combinations are not implemented by the Windows OS but with each graphic card manufacturer. And sadly many of the more recent drivers no longer support this functionality.
In order to rotate the screen you need to use the display settings.
Either : Right-Click the desktop and choose “Display Settings”
or
Start > Settings > System > Display
Next: Select the display you want to rotate and scroll down to “Display Orientation”
Choose the orientation depending on the rotation of your mount. The options are:
- Landscape
- Portrait
- Landscape (flipped)
- Portrait (flipped)
Sadly the quick switching of displays may be gone but at least the ability still exists.
Dos: Adding commands to the PATH
When you install a new piece of software that does not add itself to the Windows PATH variable, you may find your self
needing it to be run from a command prompt. You could type the full command path each time you run the executable, but
it may be easier to add the directory to the PATH variable so that it is always available.
To add it for the current command prompt:
set PATH=%PATH%;"C:Program FilesSometool"
This will add the variable to the current command prompt environment but will go away once you close the window and will not
be available to other prompts unless you type it in again.
To add it to the Windows Environment, you can use the My Computer->Properties menu to select the “Advanced System Settings”
in Windows 7 to then select the “Environment Variables…”. Now the choice you have is to add it to the System variables or
the User variables for.
If you choose the System varables you will be adding it to the system as a whole and any other user who logs in will have
the updated path. If you add it to the User variables, then it is only available to your user.
Whichever you choose, select the Path entry and click the “Edit…” button. This will pop up a dialog that will let
you add to the “Variable Value” entry. Now you will need to decide whether you want your new path at the beginning, end,
or somewhere in the middle. You might add it to the beginning if it is being used to override an existing command. You
may add to the end if there is no conflict with other installs. And finally, you may need to choose the middle if there
are some commands you need to override but others that need to be left alone.
Entries are separated by the semi-colon “;” character in DOS.
Viewing many different video formats on Windows
So I lost my hard drive and went to play some of the videos that I have saved on the system and could no longer play them in Windows Media Player. I needed to download a set of video codecs to play my .vob files. I am using the K-Lite Codec Pack.
Featured Software
VIDEO CODECS
FFDShow MPEG-4
DivX 8
Koepi’s XviD Codec
DScaler MPEG Filters
Ogg Codecs
Xvid Video Codec
Nic’s XviD Codec
Ligos Indeo Codec
AUDIO CODECS
MPEG Layer-3 Codec
AC3 Filter
AC-3 ACM Codec
CoreVorbis Decoder
LAME DirectShow Filter
LAME MP3 Encoder
Monkey’s Audio
Vorbis Ogg ACM Codec
This allows me to view the files in other video apps as well.
Retrieve drive letter on Windows
The other day I had to write a script to change to a working directory and back to the original directory. The problem was they were on different drives on Windows. So I had to find a way to capture the drive letter
and switch back to that drive. When using the following command,
cd F:somedir
you are not moved to the “F:” drive without an explicit “F:” command.
The cd Command on windows will show the current directory location. Using some string manipulation on that and capturing it to a variable allows us to go back to that drive.
REM Capture the current drive letter set ORIGDRIVE=%cd:~0,2% F: REM some other scripting things here REM Return to the original drive letter ORIGDRIVE
The first line captures the current drive letter by specifying the first character with 0 and the ,2 states to pick up the next 2 characters which would hold the “C:” or whatever drive you started on.
Windows: Grep for windows
If you don’t have access to a Unix environment on your windows box, you can still search files with findstr. The findstr command will allow you to search files close to the same way as grep.
findstr /S "search string"
will recursively find your string in the current directory and subdirectories.
There are more options that you can find if you run the following command:
findstr /?
will show you the help message.
Edit the hosts file
If you have every wanted to set certain IP addresses in your network without depending on a nameserver, you can edit the ‘hosts’ file in your operating system. This can be done to stop access to any inappropriate sites as well.
The hosts file in Windows is:
%systemroot%System32driversetchosts
This is typically in:
c:windowsSystem32driversetchosts
On linux this file is:
/etc/hosts
The common layout of the file is
<IP address> hostname [hostname]
So if would look something like this:
127.0.0.1 localhost 192.168.2.222 homeserver homeserver.mydomain.net 127.0.0.1 badlocation
Remember that these lookups happen before looking to a nameserver. So this will override any name lookup. So if you happen to do this on a laptop that you regularly use outside of your home network, make sure that you do not override an address that might be needed when you are not at home.
You will need appropriate privileges to access the file. So you may have to be root or use sudo on Linux and you may have to open an editor as administrator before opening the file on Windows.