Skip to content

Instantly share code, notes, and snippets.

@maciakl
maciakl / profile-cleanup.cmd
Last active February 12, 2024 19:48
A script to delete user data for those occasions where you just want to nuke all user data without reimaging machine.
@echo off
REM use this file to run the powershell script bypassing the policy restrictions
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dpn0.ps1'"
pause
@maciakl
maciakl / gist:4571322
Last active January 19, 2024 21:14
Google Chrome and Firefox use the Ctrl+K shortcut to initiate search. The equivalent Cmd+K version is missing from OSX release of Chrome. Here is how to add it back.

Enabling Cmd+K in Chrome for OSX

  1. Go to System Preferences.
  2. Click on Keyboard
  3. Go to Keyboard Shortcuts tab
  4. Select application shortcuts in the the left pane
  5. Click the plus sign on the right side under the left pane
  6. Select Google Chrome from the Application dropdown
  7. Type in: "Search the Web..."
@maciakl
maciakl / elevate.cmd
Last active January 8, 2024 00:11
If your batch file needs to run as Administrator, put this at the top of your script. It will initiate a UAC prompt and run the rest of the script in elevated mode.
if "%1" == "elevated" goto start
powershell -command "Start-Process %~nx0 elevated -Verb runas"
goto :EOF
:start
rem your code goes here
@maciakl
maciakl / .tmux.conf
Created August 22, 2023 04:47
Minmal tmux config file for servers
# remap prefix to C-a
set -g prefix C-a
unbind-key C-b
bind-key C-a send prefix
# set 256 bit color mode
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",*256col*:Tc"
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set-environment -g COLORTERM "truecolor"
@maciakl
maciakl / MC Cheat Sheet
Last active June 7, 2023 19:45
Midnight Commander Cheat Sheet
Shortcut Description
---------------------------------------------------------------
C-o Drop to the console
* Invert selection on files
A-s Incremental search
A-o Open selected directory in opposite panel
A-. Toggle "Show Hidden Files" feature
A-Enter Put name of the highlighted file on command line
@maciakl
maciakl / gist:5039730
Created February 26, 2013 16:18
Word 2007 Configuring Every Time - Quick Fix:

Word 2007 Configuration Fix

If you have Word 2003 and 2007 installed on the same machine, recent updates might have caused a condition in which 07 it runs the configuration dialog every time you open a document. A quick workaround is:

  • Open regedit
  • Navigate to HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Word\Options
  • Create new DWORD called NoReReg
  • Give it a hexadecimal value of 1
@maciakl
maciakl / servicetag.cmd
Created March 11, 2015 03:04
Windows batch script to find vendor tag / serial number (eg. Dell Service Tag), vendor name, model name and installed OS on the current machine. All the info is dumped into info.txt file on the Desktop.
@echo off
rem This script will attempt to find this systems Dell Service Tag
rem The tag will be recorded in info.txt on the desktop
mode 15,1
title [~]
set FILE="%USERPROFILE%\Desktop\info.txt"
@maciakl
maciakl / gist:1584387
Last active February 4, 2023 18:32
Git Workflow
# GIT WORKFLOW
# (c) Luke Maciak
# Initialize:
git init
# Check Out:
git clone username@host:/path/to/repository
@maciakl
maciakl / uxp.cmd
Last active September 1, 2022 01:24
Helper script to improve Windows 10 user experience.
@echo off
if "%1" == "elevated" goto start
powershell -command "Start-Process %~nx0 elevated -Verb runas"
goto :eof
:start
@echo off
cls
@maciakl
maciakl / branding.cmd
Created July 1, 2022 05:06
Interactive helper script to change Registered Owner and Registered Organization registry values.
@echo off
if "%1" == "elevated" goto start
powershell -command "Start-Process %~nx0 elevated -Verb runas"
goto :eof
:start
@echo off
cls
echo.