Skip to content

Instantly share code, notes, and snippets.

wakeonlan -i 10.10.10.64 -p 7 a8:60:b6:1c:8a:59
@hgfranco
hgfranco / nginxproxy.md
Created May 29, 2020 18:31 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

stat -f %Sm -t %Y-%m-%d file.txt
@hgfranco
hgfranco / Grow EC2 ELB
Last active March 26, 2019 18:57
Grow EC2 ELB
1 - Shutdown instance
2 - Modify volume in the AWS console
3 - sudo growpart /dev/xvda 1
4 - sudo resize2fs /dev/xvda1
curl -s 169.254.169.254/latest/meta-data/iam/info
https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_iam-ec2.html
@hgfranco
hgfranco / ansible-adhoc-aws
Last active April 22, 2019 14:58
Run ansible AWS adhoc command
AWS_PROFILE=francotech ansible -i inventory/ec2.py -a "sudo systemctl restart httpd" tag_name_webserver
aform.NodeRootVariable
var.environment - *terraform.NodeRootVariable
var.environment_short - *terraform.NodeRootVariable
var.instance_ami_id - *terraform.NodeRootVariable
var.instance_count - *terraform.NodeRootVariable
var.instance_type - *terraform.NodeRootVariable
var.profile - *terraform.NodeRootVariable
var.region - *terraform.NodeRootVariable
*terraform.NodeRootVariable
var.environment - *terraform.NodeRootVariable
# Create the ALB
resource "aws_alb" "nexus_alb" {
name = "nexus-alb"
internal = true
load_balancer_type = "application"
security_groups = ["${aws_security_group.alb.id}"]
subnets = ["${data.aws_subnet_ids.nexus_vpc_subnets.ids}"]
access_logs {
bucket = "${aws_s3_bucket.nexus-s3-bucket-logs.bucket}"
@hgfranco
hgfranco / README.md
Created October 8, 2018 16:23 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@hgfranco
hgfranco / erase_raid_metadata.txt
Last active March 16, 2018 13:34
How to Clean RAID Signatures on Linux
How to Clean RAID Signatures on Linux
RAID systems such as MegaRAID add signatures to disks to maintain the infomration on these didks. When we simply remove these disks and install them to another server, Linux on the new server may detect these RAID signature infomration and refuses to continue write to the disk. Here is one example that mkfs reports “apparently in use by the system” and refuses making a filesystem. It is reasonable to do so for the sake of data safety in case someone accidentally moved a disk with useful data.
However, we will need to clean these signatures when we are sure that these disks are not used anymore and we are safe to clean it. The reality is that cleaning the metadata is not that staightforward. In this post, I will discuss common problems and how to fix them to clean the RAID metadata information. The instructions are based on Fedora systems. For other systems, you most likely only need to change the method installing the packages.
Note that the instructions here are danger