Skip to content

Instantly share code, notes, and snippets.

View anamorph's full-sized avatar
🇧🇭
Hello from sunny Bahrain !

Nicolas David anamorph

🇧🇭
Hello from sunny Bahrain !
View GitHub Profile
@anamorph
anamorph / enable_cloudtrail.sh
Created October 30, 2015 20:45
# Create trails in all AWS standard regions with the AWS CLI and Linux.
# Create trails in all AWS standard regions with the AWS CLI and Linux.
SCRIPTNAME=$0
if [ -z $3 ]
then
echo "$SCRIPTNAME is missing parameters.
Usage: $SCRIPTNAME bucket region profile
Example: $SCRIPTNAME my-cloudtrail-bucket eu-west-1 default"
else
CLOUDTRAIL_S3_BUCKET=$1
REGION_FOR_GLOBAL_EVENTS=$2
@anamorph
anamorph / applescript-mslync-update-location.scpt
Last active December 2, 2015 18:10
applescript-mslync-update-location.scpt
(*
applescript-mslync-update-location
author: [email protected]
desc: the idea with this is to update your location in Microsoft Lync according to your network location.
update the following to adapt to your usage:
MYNIC to your network interface name
MYSSID to your wifi's ssid
MYIPRANGE to your wireless network ip range (referenced above via MYSSID)
@anamorph
anamorph / aws_enable_NAT.sh
Created December 17, 2015 13:22
Standard NAT enablement for AWS EC2 Instances
#!/bin/bash
# Configure the instance to run as a Port Address Translator (PAT) to provide
# Internet connectivity to private instances.
function log { logger -t "vpc" -- $1; }
function die {
[ -n "$1" ] && log "$1"
log "Configuration of PAT failed!"
exit 1
@anamorph
anamorph / powermac-g5_ubuntu_and_audio.txt
Last active December 22, 2015 01:02
PowerMac g5 - ubuntu & Audio
### info
this works on my powermac g5 dual 1.8ghz with ubuntu 14.04.
#### modify /etc/modules to match:
apm_emu
loop
# snd-powermac
snd_aoa_i2sbus
snd_aoa_fabric_layout
# snd_aoa_codec_tas
snd_aoa_codec_onyx
@anamorph
anamorph / OpenBSD-install-awscli_aws-shell.txt
Last active August 23, 2022 07:21
OpenBSD-install-awscli_aws-shell
# uname -a
OpenBSD foo.openlab.fr 5.8 GENERIC#1170 amd64
# export PKG_PATH=http://ftp2.fr.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`/
# pkg_add python
quirks-2.114 signed on 2015-08-09T11:57:52Z
quirks-2.114: ok
Ambiguous: choose package for python
a 0: <None>
1: python-2.7.10
2: python-3.4.3
@anamorph
anamorph / .gitignore
Last active January 26, 2016 09:28 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@anamorph
anamorph / list_amazon-linux-AMI.sh
Created April 5, 2017 13:41
Listing all Amazon Linux AMI ever, full #AWS #CLI
aws ec2 describe-images --owners amazon --query 'reverse(sort_by(Images[*].{Id:ImageId,Type:VirtualizationType,Created:CreationDate,Storage:RootDeviceType, Desc:Description}, &Created))' --filters "Name=description,Values=Amazon Linux AMI*" --output table
@anamorph
anamorph / gist:b861de7f06835eaee54177b3abd830c0
Created November 18, 2017 12:28
Build GCC 4.9.2 for C/C++ in CentOS 7
sudo yum install libmpc-devel mpfr-devel gmp-devel
sudo yum groupinstall "Development tools"
cd /tmp
curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.2/gcc-4.9.2.tar.bz2 -O
tar xvfj gcc-4.9.2.tar.bz2
cd gcc-4.9.2
./configure --disable-multilib --enable-languages=c,c++
make -j 4
@anamorph
anamorph / CreateCloudTrailLogBucket.yaml
Last active February 8, 2018 18:18
Creates an s3 bucket with a LifecyclePolicy moving files to Glacier after 1 year and deleting them after 5 years. This also creates a BucketPolicy to make sure only CloudTrail can write to the bucket. I use this scenario for log collection and analysis.
Description:
This template creates an s3 Bucket for CloudTrail logs; it is set up with
the appropriate bucket policies defined to receive logs only from CloudTrail.
It also includes a LifecyclePolicy moving files to Glacier after 1 year.
Parameters:
EnvironmentName:
Description:
An environment name that will be used for tags.
@anamorph
anamorph / virt-manager_on_macosx.md
Last active March 14, 2024 01:27
How to install Virt Manager on MacOS X to manage my lab vms at home :-)

based on https://github.com/jeffreywildman/homebrew-virt-manager/

let's tap into Jeffrey's repo

brew tap jeffreywildman/homebrew-virt-manager

installing py2cairo as it is required for py3cairo (?!)

brew install py2cairo

now installing virt-manager & virt-viewer

brew install virt-manager virt-viewer

installing xquartz

brew cask install xquartz