Skip to content

Instantly share code, notes, and snippets.

View nordineb's full-sized avatar

Nordine Ben Bachir nordineb

View GitHub Profile
@m-radzikowski
m-radzikowski / script-template.sh
Last active February 29, 2024 04:20
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@nordineb
nordineb / keybase.md
Created March 26, 2018 14:36
GitHub identity

Keybase proof

I hereby claim:

  • I am nordineb on github.
  • I am nordineb (https://keybase.io/nordineb) on keybase.
  • I have a public key whose fingerprint is D8A3 E77F 6D7C 29F9 C577 07BC 0045 F242 17B5 7521

To claim this, I am signing this object:

@mackwage
mackwage / windows_hardening.cmd
Last active March 24, 2024 10:55
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Obligatory 'views are my own'. :)
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
:
@plillevold
plillevold / DeployToAzure.ps1
Last active August 29, 2015 13:56 — forked from PaulStovell/DeployToAzure.ps1
Modified version of the bundled Windows Azure deployment process used by Octopus 2.0. This version will do a deploy to Staging, VIP swap to Production and then delete the Staging slot
## --------------------------------------------------------------------------------------
##
## This script is used to control how we deploy packages to Windows Azure.
## Orignial script (https://gist.github.com/PaulStovell/5234255) customized for
## Staging-To-Production with VIP swap deployment.
##
## NOTE: the script will only do Staging+VIP swap if $OctopusAzureSlot == "Staging".
## If $OctopusAzureSlot == anything else, the script will deploy directly to that slot
## without any further swapping.
##
@johnkors
johnkors / PreDeploy.ps1
Created February 6, 2014 16:29
Octopus Deploy - PreDeploy.ps1 for Windows Azure when wanting to modify Cloud Service instance count and/or certificate thumbprint values.
<#
.SYNOPSIS
Modifies some Azure cscfg entries that Octopus Deploy 2.0 is not able to as of today.
.DESCRIPTION
Sets the thumbprint of the first certificate value. Sets the instance count for each role. Octopus-variables must match either of the two forms:
Azure.Role[rolename].Instances
Azure.Role[rolename].Certificate
where rolename is the roleName as defined in the ServiceConfiguration.Cloud.csfcg.
The config file must be named ServiceConfiguration.Cloud.cscfg.
#>
try{
Import-Module WebAdministration
Get-WebApplication
$webapps = Get-WebApplication
$list = @()
foreach ($webapp in get-childitem IIS:\AppPools\)
{
$name = "IIS:\AppPools\" + $webapp.name
$item = @{}