Skip to content

Instantly share code, notes, and snippets.

View ddepaoli3's full-sized avatar
🌶️
automation in progress

Daniel Depaoli ddepaoli3

🌶️
automation in progress
View GitHub Profile
@ddepaoli3
ddepaoli3 / userdata-ubuntu-vnc.sh
Created March 11, 2019 19:11
Userdata for Ubuntu for installing desktop environment and VNC server
#!/bin/bash
#Password: passed with argument or autogenerated
autogenpass=`date +%s | sha256sum | base64 | head -c 15 ; echo`
password=${1:-$autogenpass}
mkdir /root/.vnc
sudo apt-get update
sudo apt-get install --yes git ansible
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxQL7TEG11D4xPl6CD/IqA+ao3aDTgzrMDVtTLl2sFnbhWbJEu6nJmCSYbjtYGUAKe4Qr84eh2tL3kYNnO4MvrxtHDlYe0f4BH1YSbOYZsKRXXHcZb/50gj1uJLd/TwiN3HcPDu+x8VhAFfp8O4iK10q3IPTd7scoWOjVhcCyT6/aZwILA6W1EpGxc13aqRG/HG/nD4zR7zjwrWK9o0mktVcmoEW4j0lCdsP4OPwpqUaaYpclijufnvLJFc64fo7w8Vtncf73cISenJKmPfVmDhA3UNtGlP+AAnJBR0/KC8Ol0kxmmHMKjahrVbFmB23vXqAH0EhnwCeFFtucOVWhF daniel@xpeppers
#!/usr/bin/env python
'''
Credits: https://github.com/infodox/python-pty-shells
'''
"""
Reverse Connect TCP PTY Shell - v1.0
infodox - insecurety.net (2013)
Gives a reverse connect PTY over TCP.
For an excellent listener use the following socat command:
@ddepaoli3
ddepaoli3 / gitlab-to-bitbucket.py
Created June 21, 2018 07:49 — forked from danhper/gitlab-to-bitbucket.py
Script to migrate repositories from GitLab to Bitbucket
import os
import re
import subprocess
import requests
GITLAB_ENDPOINT = os.environ["GITLAB_ENDPOINT"]
GITLAB_TOKEN = os.environ["GITLAB_TOKEN"]
@ddepaoli3
ddepaoli3 / osx-init.sh
Last active April 27, 2018 08:50
Initial installation and configuration script for Mac Osx High Sierra
#!/bin/bash
# install Xcode Command Line Tools
# https://github.com/timsutton/osx-vm-templates/blob/ce8df8a7468faa7c5312444ece1b977c1b2f77a4/scripts/xcode-cli-tools.sh
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress;
PROD=$(softwareupdate -l |
grep "\*.*Command Line" |
head -n 1 | awk -F"*" '{print $2}' |
sed -e 's/^ *//' |
tr -d '\n')
@ddepaoli3
ddepaoli3 / install_xrdp.sh
Last active March 11, 2019 18:35
Install and configure xrdp server in Centos 7
#!/bin/bash
#Password: passed with argument or autogenerated
autogenpass=`date +%s | sha256sum | base64 | head -c 15 ; echo`
password=${1:-$autogenpass}
#Install
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
yum groupinstall -y "Server with GUI"
@ddepaoli3
ddepaoli3 / extract_url_from_har.py
Created October 17, 2017 13:24
Tool per test di carico con httperf
#!/usr/bin/env python
import json
import sys
if len(sys.argv) != 2:
print "no input file"
exit(-1)
file=open(sys.argv[1], 'r')
@ddepaoli3
ddepaoli3 / schedule.py
Last active September 18, 2017 15:31
Schedule url call with lambda
#!/usr/bin/env python
import urllib2
URL="https://example.com"
def call_url(event=None, context=None, url=URL):
urllib2.urlopen(url).read()
if __name__ == '__main__':
@ddepaoli3
ddepaoli3 / postfix.sh
Last active December 18, 2018 17:15
Install postfix server on aws linux ami
#!/bin/bash
DOMAIN=example.com
USERNAME=admin
# Configure hostname
sed s/"127.0.0.1 localhost"/"127.0.0.1 $DOMAIN localhost"/ -i /etc/hosts
sed s/HOSTNAME.*/HOSTNAME=$DOMAIN/ -i /etc/sysconfig/network
# Intall server and mutt
@ddepaoli3
ddepaoli3 / a_cloudformation_wrapper.sh
Last active September 9, 2023 04:34
Simple wrapper script to create or update multiple cloudformation script
#!/bin/bash
PROFILE=${PROFILE:-'profile-name'}
PROJECT=${PROJECT:-'project-name'}
ENV=${ENV:-'environment'}
REGION=${REGION:-'eu-west-1'}
PARAMETERS_FOLDER=${PARAMETERS_FOLDER:-'parameters'} # '.' if the same folder
TEMPLATE_EXTENSION=${TEMPLATE_EXTENSION:-'yml'} #or yml. Depends on your preference
ENVIRONMENT_PARAMETER_NAME=${ENVIRONMENT_PARAMETER_NAME:-'EnvironmentVersion'}