All about Information Technology!

file

Hide|Show extensions for known file types from cmd

Open command line window and execute: Hide extensions reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 1 /f Show Extensions reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 0 /f

>>

, , , , ,

Connect to a file share

We are going to use the net use command. usage: net use drive_letter: \\ip_address\shared_folder_name or net use drive_letter: \\computer_name\shared_folder_name example: net use K: \\192.168.1.10\myshares or net use K: \\george-pc\myshares

>>

, , ,

Extract all printable characters from binary files

Strings is a very useful command that can extract all printable characters from binary files. Example: strings /usr/sbin/visudo | more /lib64/ld-linux-x86-64.so.2 __gmon_start__ libc.so.6 __printf_chk setgrent fnmatch readdir execv _IO_putc setlocale fopen strsignal strncmp optind strrchr __progname dcgettext getpwuid closedir getgrgid getdomainname fork futimes –More–

>>

, , , , , , ,

Convert file from Latin or Greek to UTF8 encoding

Convert file from Latin to UTF8 iconv -f ISO-8859-1 -t UTF-8 myfile.txt > mynewfile.txt   Convert file from Greek to UTF8 iconv -f ISO-8859-7 -t UTF-8 myfile.txt > mynewfile.txt

>>

, , , , ,

Reset Windows Hosts File

Method 1 1. Open file X:\Windows\System32\drivers\etc\hosts with notepad and paste the following contents into hosts file. # Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept [...]

>>

, , , ,

Start or Stop Windows Service using batch file

Start Windows Service Open notepad and create a new file named for ex start_my_service.bat. Paste in file the following lines: @echo off echo "starting my_service" net start "my_service" echo "done" @echo on   pause Save the file, right click on it and select “Run as administrator..” to run it! Stop Windows Service Open notepad and [...]

>>

, , , , , , , , ,

Get a list of currently logged in users in Windows Server

To get a list of currently logged in users in your Windows Server, open a cmd console and issue the following command: query session You will get a response like this: X:\path\to\somewhere>query session SESSIONNAME USERNAME ID STATE TYPE DEVICE services 0 Disc >console my_user_name 3 Active rdp-tcp 65536 Listen   X:\path\to\somewhere>

>>

, , , , , , , , , , , ,

User is not in the sudoers file

If you are getting this message while you are trying to run a command that needs administrative rights, then your user probably is not allowed to use the sudo command! The solution is simple. First of all, keep a backup of file /etc/sudoers. Then, Either you run the visudo command with administrative rights to edit [...]

>>

, , , , , ,