Skip to content

Instantly share code, notes, and snippets.

@stefanteixeira
stefanteixeira / SetAccessRuleOnDirectory.ps1
Last active September 19, 2022 02:07
PowerShell script to add permissions for the MSSQLSERVER user to a directory
New-Item -ItemType Directory -Force -Path C:\Path\To\Directory
$path = "C:\Path\To\Directory"
$Acl = (Get-Item $path).GetAccessControl('Access')
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule("NT SERVICE\MSSQLSERVER", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow")
$Acl.SetAccessRule($Ar)
Set-Acl $path $Acl
@bobey
bobey / clone-projets.sh
Last active January 12, 2016 15:05
Git clone ALL the Gitlab Projets of given namespace in one command
curl -sS https://gist.githubusercontent.com/bobey/2b09d2cc72fbcc8cf551/raw/get-gitlab-projets.php | \
php -- http://gitlab.com YOUR-PRIVATE-TOKEN your-namespace | \
xargs -n 1 git clone
@kany
kany / sendmail_setup.md
Last active September 22, 2023 00:16
Setup SENDMAIL on Mac OSX Yosemite
@donnfelker
donnfelker / android-19-circle.yml
Last active March 12, 2021 13:19
Sample CircleCI Configuration For an Android App
#
# Build configuration for Circle CI
#
general:
artifacts:
- /home/ubuntu/your-app-name/app/build/outputs/apk/
machine:
environment:
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@lyuboraykov
lyuboraykov / piping.groovy
Created August 8, 2014 11:19
Execute shell command with piping in groovy
def command = 'ls | grep foo'
def output = ['bash', '-c', command].execute().in.text
@staltz
staltz / introrx.md
Last active June 2, 2024 11:03
The introduction to Reactive Programming you've been missing
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active May 1, 2024 23:17
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@hummus
hummus / gist:8592113
Last active April 26, 2024 19:45
aws cli + jq example
wget http://stedolan.github.io/jq/download/linux64/jq
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \
"Name=instance-state-name,Values=running" \
| jq -r \
".Reservations[] | .Instances[] | .InstanceId" \
aws ec2 describe-volumes --filters \
"Name=status,Values=available" \
| jq -r ".Volumes[] | .VolumeId" \
@lukhnos
lukhnos / encfs-on-ec2.md
Last active April 23, 2018 12:32
Installing encfs on an Amazon EC2 instance

encfs is not available on the default yum repository (I run a micro instance), but it's in the Extra Packages for Enterprise Linux (EPEL) repository. See Amazon's own FAQ on enabling that repository, then all you need is to run yum:

sudo yum install fuse-encfs

As of writing this installs encfs 1.7.4 for you. It's hassle-free, and so it's good.