sudo mount -t cifs -o user=dummy,domain=example.local,uid=$(id -u),gid=$(id -g),forceuid,forcegid,vers=2.0 //files.example.local/share ~/P
Tag: windows
Windows set different NTP Server
net stop w32time w32tm /config /syncfromflags:manual /manualpeerlist:"0.de.pool.ntp.org 1.de.pool.ntp.org 2.de.pool.ntp.org 3.de.pool.ntp.org" net start w32time w32tm /config /update w32tm /resync /rediscover
stuck at Install_SQLSupport_CPU64_Action
Install_SQLSupport_CPU64_Action
,C:\SQLServer2017Media\<YOUR_SQL_ENU>\1033_ENU_LP\x64\Setup
Install_SQLSupport_CPU64_Action
run SQLSUPPORT.msi
taskkill /F /FI "SERVICES eq msiserver"
Add real emojis and icons to mintty bash on windows
Installing git for windows isn’t hard anymore. I recommend installing “Git for Windows SDK” so you can install extra packages via Pacman. I like fish shell and tmux, and those aren’t included in the default installer. Either way, you can run bash and or fish on windows. The emojis and icons however don’t look very pretty, more like DOS-style.
Open a shell and cd to
C:\Program Files\Git\usr\share\mintty\emojis or C:\git-sdk-64\usr\share\mintty\emojis depending what installation you chose.
cd C:\git-sdk-64\usr\share\mintty\ mkdir emojis cd emojis curl -LO https://raw.githubusercontent.com/wiki/mintty/mintty/getemojis getemoji -d getemoji .
In mintty:
Options -> Text -> Emojis -> style: google
Options -> Text -> Character set -> UTF-8
Start-up folder on Windows Server
On Windows Server is can be a hassle to find the start-up folder/autostart folder. Quick shortcut: Win Key + R -> shell:startup
Windows share timeout
net config server /autodisconnect:-1
Enable hibernate / suspend to disk on Windows 10
I don’t know why, but the admins tend to disable hibernate via group policies from time to time. It is pretty simple to enable, but you need admin permissions.
This script first forces UAC and then enables hibernation.
@echo off :: BatchGotAdmin :------------------------------------- REM --> Check for permissions >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" REM --> If error flag set, we do not have admin. if '%errorlevel%' NEQ '0' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" exit /B :gotAdmin if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" ) pushd "%CD%" CD /D "%~dp0" :-------------------------------------- powercfg.exe /hibernate on
Windows 10 calc.exe missing
For some reason there wasn’t calc.exe on a fresh installed Windows 10. It can be fixed. Open a Powershell as Adminstrator
Get-AppxPackage -AllUsers -Name Microsoft.WindowsCalculator | %{Add-AppxPackage -Register "$($_.InstallLocation)\appxmanifest.xml" -DisableDevelopmentMode}
vim
normal mode
- [count]operation[count]{motion}
:q!
= quit without saving:x
= :wq == write and quitdd
orD
= delete lined7d
= delete the next 7 lines.
= repeat the last commandCTRL + o
= back to last cursor positionp
= insert (from register) / paste in line below cursorP
= paste obove cursor-:reg
= list registers"1p
= paste from register 1"+y
= copy into system clipboard"+p
= pate from system clipboardu
= undoCTRL + R
= redoi
= enter insert modev
= enter visual modey
= yank / copy what was selectedyy
= yank / copy line4yy
= yank 4 lines>>
= indent-<<
= unindent:E
= open file explorer (works only withset nocompatible
):bd
= buffer delete / close buffer:bn
= goto next buffer:bp
= previous buffer:ls
= list of buffers*
= Find word unter cursor-:%s/search/replace/g
g for global:%!column -t
spaces to columns$
= goto the end of the linex
= delete charater under cursorw
= goto next worddw
= delete next word0
= goto start of linez
ENTER
move view to line:terminal
Open Terminal in split view:set rightleft
right to left (exit with :set rightleft&):edit!
reload file without saving or:e!
:set nowrap
:set wrap
:set nu
Show line numbers. Reverse with nonu
–:setlocal cm=blowfish2
:X
h
j
k
l
= move cursor ( h: ← j: ↓ k: ↑ l: →:sp
= split screen (same file):sp filename
= open other file:vsp
= vertical splitCTRL + w CTRL + w
= switch between splits:hide
= close current window:only
= keep only this window:help holy-grail
= advanced help:set rightleft
= some fun
Search/Replace
R
= enter replace mode-/pattern
– search for pattern?pattern
– search backward for patternn
– repeat search in same directionN
– repeat search in opposite direction:%s/old/new/g
– replace all old with new throughout file:%s/old/new/gc
– replace all old with new throughout file with confirmations
insert mode
CTRL + n
CTRL + p
= Complete wordCTRL + x
CTRL + l
= Complete lineCTRL + r
= insert register80i
*
ESC
= insert 80 *5o
#
ESC
= insert 5 rows starting with #
:set ff=unix
= set to unix line endings- How to jump back to NERDTree from file in tab
ctrl-ww
INSERT
you can insert text from your host’s clipboard by pressing the right mouse button (default setting) or by pressing Shift + Ins. Note that this has the same effect as entering every character manually. So if you are using auto indentation in vim, this will very likely screw up your code.
To fix that, you can do the following:
Before pasting into vim, enable paste mode by entering :set paste
.Press I to enter insert mode. The status bar should say -- INSERT (paste) --
now.Press Shift
+ Insert
(The auto indentation of vim should not happen.)Press Esc to leave insert mode, and disable paste mode using :set nopaste
again.
How to delete all lines of file in Vim
Type gg
to move the cursor to the first line of the file, if it is not already there.Type dG
to delete all the lines.
SSH Tricks
This is more for me than others. Sometimes I forget things like this.
SSH Dynamic Socks Proxy for the browser.
ssh -D 8888 mario@example.com Browser: Socks Proxy localhost 888
SSH Tunnel to another host
ssh -L 9090:localhost:9090 user@proxyhost -i SSHKEY ssh -L 9090:localhost:9090 -N user@TARGETSYSTEM
Posts Tagged windows
Archives by Month:
- October 2024
- August 2024
- April 2024
- January 2024
- December 2023
- November 2023
- July 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- October 2022
- September 2022
- August 2022
- July 2022
- May 2022
- March 2022
- February 2022
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- June 2021
- May 2021
- February 2021
- January 2021
- August 2020
- July 2020
- June 2020
- April 2020
- January 2020
- December 2019
- November 2019
- October 2019
- May 2019
- April 2019
- March 2019
- January 2019
- October 2018
- August 2018
- June 2018
- April 2018
- March 2018
- February 2018
- November 2017
- June 2017
- April 2017
- February 2017
- January 2017
- November 2016
- September 2016
- May 2016
- February 2016
- September 2015
- August 2015
- July 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- July 2014
- June 2014
- April 2014
- January 2014
- December 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- August 2012
- July 2012
- June 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009