Skip to content

Instantly share code, notes, and snippets.

@nixjobin
nixjobin / create-repo-metadata.sh
Created April 15, 2016 10:55 — forked from fernandoaleman/create-repo-metadata.sh
Script to create rpm repository metadata
#!/bin/sh
# This is for Redhat 64 bit versions of Linux with `createrepo` installed. If you
# do not have createrepo, you can install it with:
# yum install -y createrepo
# Change DESTDIR path to RPMS directory of your repo
DESTDIR="/var/www/repo/rhel/6"
for ARCH in x86_64
@nixjobin
nixjobin / rpm-from-source.sh
Created April 15, 2016 11:01 — forked from fernandoaleman/rpm-from-source.sh
How to create an RPM from source with spec file
# How to create an RPM from source with spec file
# This is for Redhat versions of linux. Sometimes when you search for an rpm package,
# it is either outdated or not available. The only thing available is the source code.
# You can create a custom RPM package from source.
#
# For this example, I'll be using the latest version of Git, currently v.1.7.7.3
# Step: 1
# Install rpmbuild
@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:
@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": "*"
},
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)}'
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)}'
@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>
@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>
<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>
<vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>