Skip to content

Instantly share code, notes, and snippets.

View TheJosh's full-sized avatar

Josh Heidenreich TheJosh

  • Adelaide, Australia
View GitHub Profile
@nicksantamaria
nicksantamaria / aws-get-elb-cloudfront-ips.sh
Last active November 9, 2021 19:37
Retrieve a list of CIDR ranges for AWS ELBs and CloudFront (relevant to Sydney region).
# Region: Sydney (ap-southeast-2)
# Service: ELBs.
curl -ss https://ip-ranges.amazonaws.com/ip-ranges.json | jq -arM -c '.prefixes[] | select(.region | contains("ap-southeast-2")) | select(.service | contains("AMAZON")) | .ip_prefix' | tee results.txt
# Region: Sydney (ap-southeast-2)
# Service: CloudFront.
curl -ss https://ip-ranges.amazonaws.com/ip-ranges.json | jq -arM -c '.prefixes[] | select(.region | contains("ap-southeast-2")) | select(.service | contains("CLOUDFRONT")) | .ip_prefix' | tee -a results.txt
# Region: Global
# Service: CloudFront.
@u0d7i
u0d7i / disable_vim_auto_visual_on_mouse.txt
Last active July 26, 2024 06:24
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a
@mattweber
mattweber / synstest.sh
Last active January 8, 2021 13:20
Multi-word query time synonyms in elasticsearch.
# delete old index if exists
curl -XDELETE 'http://localhost:9200/syns?pretty'
# create index with synonym analyzer and mapping
curl -XPUT 'http://localhost:9200/syns?pretty' -d '{
"settings" : {
"number_of_replicas": 0,
"number_of_shards": 1,
"index": {
"analysis": {
@plentz
plentz / nginx.conf
Last active July 27, 2024 16:11
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048