Skip to content

Instantly share code, notes, and snippets.

@nixjobin
nixjobin / AWS - Scheduled shutdown and startup of the EC2 instances
Last active September 18, 2022 14:01
AWS - Scheduled shutdown and startup of the EC2 instances
Youtube video - https://www.youtube.com/watch?v=jkn459MBNpo
#LAMBDA Stop instance index.js
const AWS = require('aws-sdk');
exports.handler = (event, context, callback) => {
const ec2 = new AWS.EC2({ region: event.instanceRegion });
ec2.stopInstances({ InstanceIds: [event.instanceId] }).promise()
<vssd:VirtualSystemType>vmx-07</vssd:VirtualSystemType>
<vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>
<Item>
<rasd:AddressOnParent>3</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:Caption>sound</rasd:Caption>
<rasd:Description>Sound Card</rasd:Description>
<rasd:ElementName>sound</rasd:ElementName>
<rasd:InstanceID>6</rasd:InstanceID>
<rasd:ResourceSubType>ensoniq1371</rasd:ResourceSubType>
<rasd:ResourceType>35</rasd:ResourceType>
</Item>
@nixjobin
nixjobin / nixhive
Last active October 27, 2018 08:31
<OperatingSystemSection ovf:id="107">
<Info>The kind of installed guest operating system</Info>
<Description>centos64Guest</Description>
<vbox:OSType ovf:required="false">centos64Guest</vbox:OSType>
</OperatingSystemSection>
@nixjobin
nixjobin / nixhive
Last active October 27, 2018 08:32
<OperatingSystemSection ovf:id="80">
<Info>The kind of installed guest operating system</Info>
<Description>RedHat_64</Description>
<vbox:OSType ovf:required="false">RedHat_64</vbox:OSType>
</OperatingSystemSection>
ps -ylC apache2 | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
ps -ylC httpd | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
@nixjobin
nixjobin / liferay-s3-bucket-policy
Created June 15, 2016 21:11
Liferay S3 Bucket Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets"
],
"Resource": "*"
},
@nixjobin
nixjobin / rpm-digital-signature.sh
Created April 15, 2016 11:01 — forked from fernandoaleman/rpm-digital-signature.sh
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response: