├── README.md ├── linux └── README.md ├── office365 └── msolConnectors.ps1 └── windows10 ├── installs.ps1 ├── keyboard-shortcuts.md └── reclaimWindows10.md /README.md: -------------------------------------------------------------------------------- 1 | # sysadmin-scripts 2 | 3 | just a collection of my scripts or scripts i've customized... 4 | 5 | licenses and descriptions in individual script files. 6 | 7 | [linux notes](./linux/README.md) -------------------------------------------------------------------------------- /linux/README.md: -------------------------------------------------------------------------------- 1 | # basic linux install setup notes 2 | 3 | ## install utils 4 | (yum = apt on debian/ubuntu, etc) 5 | 6 | sudo yum install -y cockpit cockpit-docker cockpit-machines 7 | sudo yum install -y htop 8 | sudo yum install -y tree #-L 2 9 | 10 | ## prevent memory hangs in prod (n.b. ensure monitoring) 11 | https://linuxize.com/post/create-a-linux-swap-file/ 12 | 13 | sudo fallocate -l 1G /swapfile 14 | sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576 15 | sudo chmod 600 /swapfile 16 | sudo mkswap /swapfile 17 | sudo swapon /swapfile 18 | 19 | modify `/etc/fstab` with `/swapfile swap swap defaults 0 0` 20 | 21 | verify with `sudo swapon --show` 22 | 23 | ## ufw 24 | https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands 25 | 26 | sudo ufw allow ssh 27 | sudo ufw allow 9090 28 | sudo ufw allow http https 29 | ufw enable 30 | 31 | ## nginx 32 | http://nginx.org/en/docs/beginners_guide.html#proxy 33 | 34 | ## docker 35 | 36 | docker update --restart=unless_stopped container_name 37 | docker top container_name 38 | 39 | ## AWS linux 40 | 41 | # sudo yum-config-manager --enable epel 42 | sudo yum update 43 | sudo yum install inotify-tools 44 | 45 | (persist: update `/etc/yum.repos.d/epel.repo` - epel section, change `enabled=0` to `=1`) 46 | -------------------------------------------------------------------------------- /office365/msolConnectors.ps1: -------------------------------------------------------------------------------- 1 | # Based on http://msdn.microsoft.com/en-us/library/dn568015.aspx 2 | 3 | # Run me elevated, and w/prerequisites as listed in article: 4 | # http://go.microsoft.com/fwlink/p/?LinkId=286152 5 | # http://go.microsoft.com/fwlink/p/?linkid=236297 (64b) 6 | # http://go.microsoft.com/fwlink/p/?LinkId=255251 7 | # http://go.microsoft.com/fwlink/p/?LinkId=532439 8 | # Don't forget the Session Killers section when done. 9 | 10 | # Establish Tenant Info 11 | Import-Module MsOnline 12 | $tenant = read-host "tenant ID - e.g. https://(THIS).sharepoint.com:" 13 | read-host "Next step will ask for 365 user/pass" 14 | $cred = get-credential 15 | 16 | # SharePoint Connection 17 | Import-Module Microsoft.Online.SharePoint.PowerShell 18 | $spAdminUrl = "https://" + $tenant + "-admin.sharepoint.com" 19 | Connect-SPOService -url $spAdminUrl -credential $cred 20 | get-sposite 21 | Connect-MsolService -credential $cred 22 | 23 | # Skype for Business Online Connection 24 | # note: A warning about increasing the WSMan NetworkDelayms value is expected the first time you connect and should be ignored. 25 | Import-Module SkypeOnlineConnector 26 | $sfboSession = New-CsOnlineSession -Credential $credential 27 | Import-PSSession $sfboSession 28 | 29 | # Exchange Connection 30 | $exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $credential -Authentication "Basic" -AllowRedirection 31 | Import-PSSession $exchangeSession -DisableNameChecking 32 | 33 | # Security and Compliance Center 34 | $ccSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.compliance.protection.outlook.com/powershell-liveid/ -Credential $credential -Authentication Basic -AllowRedirection 35 | # prefix means: Get-RoleGroup becomes Get-ccRoleGroup 36 | Import-PSSession $ccSession -Prefix cc 37 | 38 | # Session Killers 39 | Disconnect-SPOService 40 | Remove-PSSession $sfboSession 41 | Remove-PSSession $exchangeSession 42 | Remove-PSSession $ccSession -------------------------------------------------------------------------------- /windows10/installs.ps1: -------------------------------------------------------------------------------- 1 | #### my services / devices 2 | cinst -y microsoft-edge 3 | cinst -y spotify 4 | 5 | #### sys / file utils 6 | cinst -y vlc 7 | cinst -y sysinternals 8 | cinst -y rdcman 9 | cinst -y 7zip.install 10 | cinst -y treesizefree 11 | cinst -y winmerge 12 | cinst -y winscp 13 | cinst -y fiddler 14 | cinst -y paint.net 15 | # cinst -y baretail # can use bash 'tail' instead 16 | # cinst -y virtualbox 17 | # cinst -y wireshark 18 | 19 | #### dev 20 | cinst -y git 21 | cinst -y nodejs.install 22 | cinst -y yarn 23 | cinst -y python3 24 | cinst -y vscode 25 | cinst -y visualstudio2017buildtools 26 | cinst -y azure-cli 27 | cinst -y sql-server-management-studio 28 | # cinst -y hostsman 29 | # cinst -y firefox 30 | # cinst -y docker-desktop 31 | 32 | #### collab 33 | cinst -y slack 34 | cinst -y microsoft-teams 35 | # Licensed: https://office.com, biztree, balsamiq, pianoteq 36 | 37 | 38 | #Powershell Config 39 | find-module sharepointpnppowershellonline | install-module 40 | update-help 41 | 42 | echo "Phew. Done. Don't skip a reboot... :)" 43 | pause 44 | -------------------------------------------------------------------------------- /windows10/keyboard-shortcuts.md: -------------------------------------------------------------------------------- 1 | These simple shortcuts can help you to get around Windows 7 really fast. There's both 'obvious' & obscure stuff here, so take a moment to see how you fare :) 2 | 3 | ## Generally useful shortcuts 4 | 5 | * `Ctrl + Shift + Esc` Open task manager 6 | * `Windows Key + R` run dialog 7 | * `Winkey + D` toggle 'show desktop' 8 | * `Winkey + L` lock workstation 9 | * `Winkey + E` windows explorer 10 | * `Middle click a link (or Ctrl + Click)` load page in background tab (useful for google, reddit) 11 | * `Middle click a tab` close tab 12 | * `Middle click back button` open history in new tab (not for IE) 13 | * `Ctrl + F5` clear page cache and refresh webpage (great for page errors/testing) 14 | * `(Shift +) tab button` when filling out a form, skip to next (or previous) form field 15 | * `Alt + (shift +) tab` switch windows forwards (or backwards) 16 | * `Ctrl + (shift +) tab` switch tab/document forwards (or backwards) 17 | * `Hold Shift while inserting removable media - prevents 'autorun' 18 | * `Shift + Delete` permanently deletes files (without going to recycle bin) 19 | * `Shift + Right click` usually adds 'experienced user' context menu options 20 | * `F2` 'edit', renames selected file. Also used with spreadsheet cells. 21 | * `Ctrl + Scroll` zoom web page, document, file thumbnails, or desktop icons on Vista/7 22 | * `Ctrl + C` on any standard error dialog box - copies error report text 23 | * `Alt + PrtScn` Copies an image of the current window to clipboard 24 | 25 | A note on Ctrl + Shift + Esc: Ctrl + Alt + Del now brings up a 'lock this computer' dialog on Vista/7, so I suggest you learn this one. Another perk is that on a VM or a remote control app, this will open the remote (client) machine's task manager. 26 | 27 | ## New in Windows 7 / Vista 28 | 29 | * `Winkey + [1,2,3,4,5,6,7,8,9,0]` launch corresponding windows dock item, or app-specific alt+tab 30 | * `Winkey + Shift + [1,2,3,4,5,6,7,8,9,0]` launch a new window of dock item 31 | * `Winkey + Ctrl + Shift + [1,2,3,4,5,6,7,8,9,0]` launch a new window of dock item as administrator 32 | * `Winkey + Ctrl + [1,2,3,4,5,6,7,8,9,0]` show/hide all instances of app 33 | * `Winkey + Alt + [1,2,3,4,5,6,7,8,9,0]` show app jumplist 34 | * `Winkey + T` use keyboard arrow keys to navigate dock 35 | * `Middle click an app on dock` Open a new app instance 36 | * `Middle click a thumbnail from dock` Close app instance/tab 37 | * `Shift + drag file to a dock app` open file with dock application. (default behavior is 'pin') 38 | * `Drag up on dock item` Quick jumplist 39 | * `Shift + Right click dock item` Legacy menu 40 | * `Winkey and + or -` , zoom in/out of screen (very cool) 41 | * `Ctrl + Shift + N` New Folder 42 | * `Winkey + "c:"` browse HDD from Start Menu. Tap up, down & '\' to browse directories. 43 | * `Winkey + Search Term` Instant search. Tap up, down & enter to select. 44 | * `Winkey + [dos appname] + enter` Instant app launch: no need to wait for search. 45 | * `Alt` bring up old-style file menus where they've been removed 46 | * `Winkey + P` multi-display config quick-switch (press twice to switch) 47 | * `Winkey + X` bring up laptop settings control panel 48 | * `Winkey + (shift +) tab` Flip 3D task switcher 49 | * `Winkey + left, right, up or down key` manage window position 50 | * Drag window to left, right or top edge to 'snap' them. 51 | * If all your apps disappear for no reason, DON'T PANIC. Move your mouse away from the bottom right corner. If this bugs you, right click the bottom right corner & turn off 'peek at desktop' 52 | 53 | ## Context Menu Key 54 | 55 | * To the right of your space bar, there's a little 'right click' key. This thing is powerful on any PC. It's excellent for fixing typos in docs, renaming files, etc. 56 | * When editing spell-checked documents, this allows you to quickly fix 'red/green wavy line' spelling or grammar errors. (firefox doesn't work with this) 57 | * When a file is selected, hit the right right click key, then type 58 | * 'm' for Rename, 'r' for Properties, 'n' for Send to (e.g. USB key) or 'd' for Delete. 59 | * (Note the underlines in the menus) 60 | * When on a flash-based site, or a site with right-click disabled - hit the right click key to get 'view source', etc. 61 | * Exposes fundamental functionality when using Media Center 62 | 63 | ## Command line utilities (Winkey+R): 64 | 65 | * `resmon` win7 only, awesome resource monitor - bandwidth etc 66 | * `perfmon` - a pretty decent performance monitor (vista, xp?) 67 | * `cmd` command line 68 | * `control userpasswords2` set windows to auto-login 69 | * `dxdiag` hardware properties (processor, ram, etc) 70 | * `Winkey + pause` system properties 71 | * `regedit msconfig services.msc compmgmt.msc eventvwr appwiz.cpl` - manage system stuff 72 | * `charmap` unusual characters (also, note the keyboard shortcuts provided in its status bar only work with the numpad) 73 | 74 | ## "Obvious" (?) 75 | 76 | * `Drag with right click` provide additional options when dragging (copy/move/create shortcut) 77 | * `Esc` dismiss dialog 78 | * `Ctrl + Shift + left or right key` select a word at a time 79 | * `Ctrl + Backspace` Delete a word at a time 80 | * `Double-click window title` maximize 81 | * `Space` fill in a checkbox, press the highlighted button, or scroll down 82 | * `Tab` When filling out forms, skip forwards through inputs 83 | * `Shift + Tab` When filling out forms, skip backwards through inputs 84 | * `Ctrl + Tab` switch windows within an application (e.g. tabs) 85 | * `Alt + Tab` switch between windows 86 | * `Ctrl + F4` close tab/document 87 | * `Alt + F4` close window 88 | * `Ctrl + left/right buttons` skip text by word, rather than by letter (hold shift to select) 89 | * `Ctrl + up/down buttons` skip text by paragraph, rather than by letter (hold shift to select) 90 | * `PgUp, PgDn` Scroll up/down 1 page 91 | * `Home` Skip to top of page 92 | * `End` Skip to end of page 93 | * `Print Screen (PrtScn)` Takes a picture of your screen and puts it in the clipboard. You can paste it in paint. 94 | * `F5` refresh page/folder/dialog 95 | * `Backspace` Navigate to the previous page (web browsers) 96 | * `Ctrl + Enter` line-break (goes to next line, but not a full paragraph) 97 | * `Ctrl + Z` undo 98 | * `Ctrl + Y` redo (reverse undo - Ctrl + Shift + Z in Adobe software) 99 | * `Ctrl + X` cut 100 | * `Ctrl + C` copy 101 | * `Ctrl + V` paste 102 | * `Ctrl + S` save 103 | * `Ctrl + F` find in page/doc 104 | * `Ctrl + A` select all 105 | * `Shift + click items in a list` select a continuous group of sequential items from a list 106 | * `Ctrl + click items in a list` select multiple individual items from a list 107 | * `Ctrl + [B, I, U]` bold, italic, underline 108 | * `Ctrl + Esc or Windows Key` open start menu 109 | 110 | ## Borderline Useful (?) 111 | 112 | * `Middle click a folder of favorites` open all favorites in new tabs 113 | * `Winkey + U` 'usability' (disabled) control panel 114 | * `Winkey + [1,2,3,4,5,6,7,8,9,0]` launches corresponding quicklaunch/win7dock item 115 | * `Winkey + shift + left, right, up, down` [win7], dual screen window management 116 | * `Winkey + space` [win7] peek at desktop 117 | * `Winkey + G` [vista/7] view desktop gadgets 118 | * `Ctrl + alt + [1,2,3,4,5,6,7,8,9,0]` Creates header-level text in word processors. You can use this to auto-generate a document outline or table of contents. In web apps it's just Ctrl + [1,2...] 119 | * `Ctrl + Shift + Right click on blank area of start menu` End explorer process (to restart, ctrl+shift+esc, file -> new task, "explorer") 120 | * Lost a window? Right click the taskbar, click 'cascade windows'. 121 | -------------------------------------------------------------------------------- /windows10/reclaimWindows10.md: -------------------------------------------------------------------------------- 1 | This file is maintained here: 2 | 3 | https://gist.github.com/alirobe/7f3b34ad89a159e6daa1 4 | --------------------------------------------------------------------------------