Skip to content

Instantly share code, notes, and snippets.

View full-sized avatar

Rohan rohan-molloy

View GitHub Profile
@rohan-molloy
rohan-molloy / Disable-Teams-Autostart.md
Created August 15, 2022 09:24
How to stop teams starting at logon
View Disable-Teams-Autostart.md

Disable Teams Autostart

  1. Create the file C:\Windows\System32\GroupPolicy\User\Scripts\Logon\disableteams.cmd with the following contents
%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe -File %WINDIR%\System32\GroupPolicy\User\Scripts\Logon\disableteams.ps1
  1. Create the file C:\Windows\System32\GroupPolicy\User\Scripts\Logon\disableteams.ps1 with the following contents
$entry = $null -eq (Get-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Run)."com.squirrel.Teams.Teams"
if ( !$entry ) {
View browse-in-network-namespace.sh
#!/bin/bash
# Variables
LINK='enp0s20f0u4u3'
ADDR='192.168.8.100/24'
NETNS='testns'
BROWSER='chromium-browser'
# Create the network namespace
echo "Creating ${NETNS}" 1>&2
@rohan-molloy
rohan-molloy / download-docker-cli.sh
Created May 13, 2022 08:08
Download standalone docker cli
View download-docker-cli.sh
export DOCKERVERSION=20.10.5
curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz \
&& tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 \
-C /usr/local/bin docker/docker \
&& rm docker-${DOCKERVERSION}.tgz
@rohan-molloy
rohan-molloy / Install Windows from command line.md
Created April 30, 2022 04:59
Install windows from the command line
View Install Windows from command line.md
@rohan-molloy
rohan-molloy / Install Vmware Kernel Modules on Fedora.md
Created March 23, 2022 07:20
Install Vmware Kernel Modules on Fedora.md
View Install Vmware Kernel Modules on Fedora.md
View init.vim
call plug#begin()
Plug 'elzr/vim-json' " For metadata.json
Plug 'mrk21/yaml-vim' " For hieradata
"Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}} " Language Server support
Plug 'rodjek/vim-puppet' " For Puppet syntax highlighting
Plug 'vim-ruby/vim-ruby' " For Facts, Ruby functions, and custom providers
Plug 'vimwiki/vimwiki'
Plug 'airblade/vim-gitgutter'
Plug 'ryanoasis/vim-devicons'
@rohan-molloy
rohan-molloy / randomIPv6.js
Created August 21, 2021 05:10
generate a random ipv6 address
View randomIPv6.js
// Generate a Random Mac
function randomMac() {
return "XX:XX:XX:XX:XX:XX".replace(/X/g, function() {
return "0123456789ABCDEF".charAt(Math.floor(Math.random() * 16))
}
)
};
// Generate IPv6 EUI64
@rohan-molloy
rohan-molloy / Converting-Qcow2-to-vmdk.md
Created September 17, 2020 10:15
How to Convert Qemu images to VMWare
View Converting-Qcow2-to-vmdk.md

How to Convert Qemu images to VMWare

qemu-img convert \
         -f $INPUT_FORMAT \
         -O $OUTPUT_FORMAT \
          $INPUT_FILE $OUTPUT_FILE

For example qemu-img convert -f qcow2 -O vmdk esxi.qcow2 esxi.vmdk

View whitelist-country-iptables.sh
#! /bin/bash
# Set the country code (in lower case)
cc=nz
# Create the ipset
ipset create allowed_country hash:net
# Load the country set
wget -qO- "https://iplists.firehol.org/files/geolite2_country/country_$cc.netset" | grep -v ^# | xargs -n1 ipset add allowed_country