Skip to content

Instantly share code, notes, and snippets.

View elreydetoda's full-sized avatar

elreydetoda

View GitHub Profile
  • SC1000 $ is not used specially and should therefore be escaped.
  • SC1001 This \o will be a regular 'o' in this context.
  • SC1003 Want to escape a single quote? echo 'This is how it'\''s done'.
  • SC1004 This backslash+linefeed is literal. Break outside single quotes if you just want to break the line.
  • SC1007 Remove space after = if trying to assign a value (or for empty string, use var='' ... ).
  • SC1008 This shebang was unrecognized. ShellCheck only supports sh/bash/dash/ksh. Add a 'shell' directive to specify.
  • SC1009 The mentioned parser error was in ...
  • SC1010 Use semicolo
@elreydetoda
elreydetoda / Enable-RDP.ps1
Created November 4, 2020 13:07
enabling rdp & allowing through firewall powershell script
# thanks to https://vmarena.com/how-to-enable-remote-desktop-rdp-remotely-using-powershell/
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
mapfile -t env_varz < <(env | grep -iE 'packet|tf_|vagrant_|circle|release' | cut -d '=' -f 1)
IFS=" " read -r -a env_vars_array <<< "$(printf ' -e %s' "${env_varz[@]}")"
docker container run --rm -it "${env_vars_array[@]}" -v "${PWD}/scripts":/scripts bash
@elreydetoda
elreydetoda / Pipfile
Created September 19, 2020 21:22
[BUG] files needed for packerlicious bug: https://github.com/elreydetoda/packerlicious/issues/1
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
# for python dev
pylint = "*"
bandit = "*"
black = "==20.8b1"
@elreydetoda
elreydetoda / ansible-semver.yml
Created August 30, 2020 10:11
an ansible playbook that does semantic version sorting, more here: https://github.com/diodonfrost/ansible-role-vagrant/pull/1
---
- hosts: localhost
tasks:
- name: Linux | Find all versions of Vagrant
uri:
url: https://releases.hashicorp.com/vagrant/index.json
return_content: yes
register: vagrant_index
# this was the original code from here: https://github.com/diodonfrost/ansible-role-vagrant/blob/master/tasks/setup-Linux.yml#L14
#!/usr/bin/env bash
set -${-//[s]/}eu${DEBUG+xv}o pipefail
season=(
'Spring'
'Summer'
'Fall'
'Autumn'
'Winter'
@elreydetoda
elreydetoda / FindOUpermissions.ps1
Last active July 23, 2020 18:30 — forked from neKuehn/FindOUpermissions.ps1
A different PowerShell script that finds permissions assigned to OUs. This one must be run from a windows system joined to the domain to be queried.
function Get-OUPermissions{
<#
.SYNOPSIS
FindOuPermissions is a Windows PowerShell script that finds all of the different OUs in a domain,
determins the permissions assigned to different users and groups, and reports back which are different
from their parent; including what those permissions are.
This script does require that the device be joined to the domain being queried and RSAT is installed.
@elreydetoda
elreydetoda / ubuntu-install.sh
Last active April 25, 2020 13:37
installing all things for ubuntu script
#!/usr/bin/env bash
set -exuo pipefail
##################################################
### Variables
## apt
apt_repos=(
'ppa:kgilmer/regolith-stable' # https://blog.elreydetoda.site/minimal-i3-gaps-install-ubuntu/
'ppa:linuxuprising/shutter' # awesome screenshotting software
@elreydetoda
elreydetoda / Vagrantfile
Last active March 27, 2020 07:01
[personal-blog] Vagrant file used for x11 fowarding blog post https://blog.elreydetoda.site/vim-clipboard-over-ssh/
# https://github.com/elreydetoda/vagrant-files/tree/master/bento_ubuntu-18.04
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04"
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y xauth
SHELL
end
@elreydetoda
elreydetoda / Vagrantfile
Last active March 27, 2020 06:57
[personal-blog] Vagrant snippet for x11 fowarding https://blog.elreydetoda.site/vim-clipboard-over-ssh/
# https://computingforgeeks.com/how-to-enable-and-use-ssh-x11-forwarding-on-vagrant-instances/
# used in https://github.com/elreydetoda/vagrant-files/
config.ssh.forward_agent = true
config.ssh.forward_x11 = true