Skip to content

Instantly share code, notes, and snippets.

View kapb14's full-sized avatar
😤

Aleksandr Karushin kapb14

😤
View GitHub Profile
@kapb14
kapb14 / 0_reuse_code.js
Created May 15, 2014 10:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kapb14
kapb14 / easy_search_in_bash_history
Created October 21, 2015 09:06
easy search in bash history
cat <<EOF > ~/.inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[1~": beginning-of-line
"\e[4~": end-of-line
EOF
@kapb14
kapb14 / bash_check_execution_via_sudo
Created October 21, 2015 09:14
bash. проверка запуска через sudo
if [ "$UID" != "0" ]; then
echo "$UID"
echo "Please run as root or via sudo"
exit
else
echo "$UID"
echo "OK."
fi
@kapb14
kapb14 / disable_hyperV_without_deinstalling
Last active October 21, 2015 16:56
disable Hyper-V without deinstalling it
disable Hyper-V without deinstalling it
You can disable Hyper-V without deinstalling it. Start a command prompt with administrator rights and execute the following command:
CODE: SELECT ALL EXPAND VIEW
bcdedit /set hypervisorlaunchtype off
Reboot windows. Hyper-V is disabled now. If you want to enable it, then run this command:
CODE: SELECT ALL EXPAND VIEW
@kapb14
kapb14 / sudo.cmd
Created October 21, 2015 17:00
simplest "sudo" for Windows
:: save this file as "sudo.cmd" and place it in your %PATH%
@echo Set objShell = CreateObject("Shell.Application") > %temp%\sudo.tmp.vbs
@echo args = Right("%*", (Len("%*") - Len("%1"))) >> %temp%\sudo.tmp.vbs
@echo objShell.ShellExecute "%1", args, "", "runas" >> %temp%\sudo.tmp.vbs
@cscript %temp%\sudo.tmp.vbs
@kapb14
kapb14 / gist:f626dd58d5329e98b30a
Last active October 23, 2015 10:29
Если "пропал" значок Internet Explorer в Windows 8/8.1
Если "пропал" значок Internet Explorer в Windows 8/8.1
1. Go to the Start screen.
2. Type cmd.
3. Click the cmd.exe icon on the left side of the screen to open a Command Prompt window.
Important Do not select the option to run the program as an administrator.
4. At the command prompt, enter the following command:
C:\Windows\System32\ie4uinit.exe -UserIconConfig
@kapb14
kapb14 / gist:a4dacb176b2bcc378397
Last active October 23, 2015 11:41
как посмотреть информацию о железе из CMD.exe (PsExec)
как посмотреть информацию о железе из CMD.exe (PsExec)
# модель процессора
wmic cpu get name,CurrentClockSpeed,MaxClockSpeed
# версия BIOS
wmic bios get name,serialnumber,version
@kapb14
kapb14 / get_cpu_temp_celsius.bat
Created October 23, 2015 14:41
get Cpu temperature (in Celsius) using 'wmic' from .bat
@echo off
:: for /f "delims== tokens=2" %%a in (
:: 'wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CurrentTemperature /value'
:: ) do (
:: set /a degrees_celsius=%%a / 10 - 273
:: )
::
:: echo %degrees_celsius%
@kapb14
kapb14 / gist:6ae592fca9824ebe5c41
Created October 23, 2015 15:52
Sharepoin SQL alias
Before running the PSConfig , we have to configure the SQL Client Alias. There will be two versions of cliconfig in 64 bit operating system.
C:\Windows\System32\cliconfg.exe - 64 bit version of cliconfig.exe
C:\Windows\SysWOW64\cliconfig.exe – 32 bit version of cliconfig.exe
SharePoint 2010 & 2013 are 64 based so we have to configure the 64 bit version of cliconfig.
C:\Windows\System32\cliconfg.exe
@kapb14
kapb14 / gist:06588e8e5228f484e39d
Created December 17, 2015 12:27
Hostname/Network config script for Kickstart
#!/bin/bash
#
# https://m.reddit.com/r/sysadmin/comments/1b1ezy/hostnamenetwork_config_script_for_kickstart/
#
HWADDR=`ifconfig eth0 | grep HW | awk ' BEGIN { FS = " " } ; { print $5 } ; '`
hostn=""
mode=""
hostfile="/etc/sysconfig/network"