Skip to content

Instantly share code, notes, and snippets.

View nvnivs's full-sized avatar

Nuno Pereira nvnivs

View GitHub Profile
@nvnivs
nvnivs / mirrorlist
Last active May 26, 2018 11:12
Fix for `error: GPGME error: No data` in Arch. Replace contents of `/etc/pacman.d/mirrorlist`
################################################################################
################# Arch Linux mirrorlist generated by Reflector #################
################################################################################
# With: reflector -l 50 -f 10 --save /etc/pacman.d/mirrorlist
# When: 2015-09-13 07:40:54 UTC
# From: https://www.archlinux.org/mirrors/status/json/
# Retrieved: 2015-09-13 07:40:35 UTC
# Last Check: 2015-09-13 07:28:48 UTC

Setup

Install Qemu

brew install qemu-system-x86_64

Download Arch

@nvnivs
nvnivs / Create-FolderJunction.ps1
Created November 6, 2015 13:49
Create a junction path between two folders
# REMARK: By default UNC to local junctions are disabled
# To find out run 'fsutil behavior query SymlinkEvaluation'
# To enable run 'fsutil behavior set SymlinkEvaluation R2L:1'
$source = 'd:\folder-a'
$target = 'd:\folder-b'
Robocopy $source $target /MIR /R:12 /W:5
Invoke-Expression "cmd.exe /c attrib +r $source\\*.* /s"
@nvnivs
nvnivs / FileUtils.psm1
Last active August 29, 2015 14:24
Calculates the total size used by child folders of the specified location
function Get-TreeLength {
<#
.SYNOPSIS
Calculates the total size used by child folders of the specified location
.PARAMETER path
The root path
.PARAMETER depth
How many levels deep in the folder structure to go.
Defaults to 0, displays sizes of all subfolders of path
The higher the depth value is the slower it will be to fetch the inital
@nvnivs
nvnivs / SslV2-Disable.ps1
Created October 30, 2014 11:22
Disables SSL v2 protocol on IIS
<#
.SYNOPSIS
Disables SSL v2 protocol on IIS
#>
function Create-SubKey {
param(
[parameter(position=0)]$path,
[parameter(position=1)]$key,
[parameter(position=2)]$subKey
@nvnivs
nvnivs / SslV3-Disable.ps1
Last active August 29, 2015 14:07
Disables SSL v3 protocol on IIS for POODLE vulnerability. Requires a server restart to become effective.
<#
.SYNOPSIS
Disables SSL v3 protocol on IIS for POODLE vulnerability
.LINK
https://www.digicert.com/ssl-support/iis-disabling-ssl-v3.htm
#>
function Create-SubKey {
param(
[parameter(position=0)]$path,
@nvnivs
nvnivs / List-Iis6SiteBindindsAndARecord.ps1
Last active August 29, 2015 14:07
Iterates through enabled IIS 6 websites and lists their bindings and A records. Useful in preparation to decommission Windows 2003 web servers. @PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/z0c/1386ec085f71409d6ee0/raw/'))"
<#
.Synopsis
Iterates through enabled IIS 6 websites and lists their bindings and A records.
Useful in preparation to decommission Windows 2003 web servers.
#>
$output = @()
$sites = Get-WmiObject -Class IIsWebServerSetting -Namespace "root\microsoftiisv2" -filter "ServerAutoStart=True"
foreach ($site in $sites) {
foreach ($binding in $site.ServerBindings) {
@nvnivs
nvnivs / VutureVx-DevelopmentSetup.ps1
Last active October 22, 2015 10:24
@PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/z0c/f3541a9d083c8caf0b04/raw/'))"
<#
.Synopsis
Installs all required components for Vuture Vx development on a vanilla environment
.Link
https://gist.github.com/z0c/f3541a9d083c8caf0b04
#>
# DEPRECATED: Moving to Chef
# Broken due to changes in chocolatey 0.9.9
# Custom package sources not implemented in current version of chocolatey
@nvnivs
nvnivs / Acl-RemoveInheritablePermissions.ps1
Last active August 29, 2015 14:02
Disables "Include inheritable permissions from this object's parent" to a given folder
<#
.Synopsis
Recursively updates the version of AssemblyInfo.cs files
.Parameter baseDir
The root directory from which to recursively search for AssemblyInfo files
Defaults to the directory of the script.
.Link
https://gist.github.com/z0c
#>
@nvnivs
nvnivs / Update-AssemblyInfo.ps1
Last active August 29, 2015 13:57
Recursivelly updates the version of AssemblyInfo.cs files
<#
.Synopsis
Recursively updates the version of AssemblyInfo.cs files
.Parameter baseDir
The root directory from which to recursively search for AssemblyInfo files
Defaults to the directory of the script.
.Link
https://gist.github.com/z0c
#>