This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# creates an LVM under a single device | |
dd if=/dev/zero of=/dev/sdb bs=512 count=64 | |
pvcreate /dev/sdb | |
pvs | |
vgcreate timeline /dev/sdb | |
lvcreate -n app -l 100%FREE timeline | |
mkfs.xfs -L APP /dev/timeline/app | |
echo '/dev/timeline/app /app xfs noatime 1 2' >> /etc/fstab | |
mkdir -p /app && mount /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate a new key | |
openssl genrsa -out server.key 2048 | |
# Generate a new CSR | |
openssl req -sha256 -new -key server.key -out server.csr | |
# Check certificate against CA | |
openssl verify -verbose -CApath ./CA/ -CAfile ./CA/cacert.pem cert.pem | |
# Self Signed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo '<html><body>'; | |
?> | |
<script> | |
function submitForm() { | |
oCombo = document.getElementById('idURLCombo'); | |
oForm = document.getElementById('idMainForm'); | |
oForm.action = oCombo.value; | |
oForm.submit(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!#/bin/bash | |
cat > embedded_perl_script<<'EOF' | |
#!/usr/bin/perl -w | |
$input = $ARGV[0]; | |
my $argc; | |
$argc = @ARGV; | |
print $input."\n" | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ page import="java.util.*" %> | |
<html> | |
<head> | |
<title>Http Request Headers Example in JSP</title> | |
</head> | |
<body> | |
<h2>HTTP Request Headers Received</h2> | |
<table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: tomcat | |
# Required-Start: $network $time $syslog | |
# Should-Start: $time | |
# Default-Start: 3 5 | |
# Default-Stop: 0 1 2 6 | |
# Short-Description: Tomcat Daemon under /opt/tomcat | |
# Description: Starts Tomcat under /opt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# | |
### BEGIN INIT INFO | |
# Provides: Apache | |
# Required-Start: $network | |
# Required-Stop: | |
# Default-Start: 3 5 | |
# Default-Stop: | |
# Description: Apache Web Server | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// curl -k https://localhost:8000/ | |
const https = require('https'); | |
const fs = require('fs'); | |
const options = { | |
passphrase: '1234', | |
dhparam: fs.readFileSync('dhparam.pem'), | |
key: fs.readFileSync('cert.key'), | |
cert: fs.readFileSync('cert.pem'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install lvm2 | |
pvcreate /dev/xvdf | |
pvs | |
vgcreate backups /dev/xvdf | |
lvcreate -n mongodb -l 100%FREE backups | |
mkfs.ext3 -L MONGOBACKUP /dev/backups/mongodb | |
echo '/dev/backups/mongodb /var/backups/mongodb ext3 defaults 1 2' >> /etc/fstab | |
mkdir -p /var/backups/mongodb | |
chmod 750 /var/backups/mongodb | |
mount /var/backups/mongodb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adjust GPS tag on files in a folder | |
exiftool -GPSLongitudeRef=W -GPSLongitude="73.87538" -GPSLatitudeRef=N -GPSLatitude=40.850581 -ext cr2 jpg jpeg . | |
# Move files into Year/Month folders in a given folder | |
exiftool "-Directory<DateTimeOriginal" -d "%Y/%m" DIR | |
# Rename files in a folder using Year Month Day Hour Minute Second format | |
exiftool '-FileName<CreateDate' -d %Y%m%d_%H%M%S%%-c.%%e DIR | |
exiftool -AllDates+=1 *.JPG | |
# Adjust file modification date | |
exiftool "-DateTimeOriginal>FileModifyDate" *.JPG | |
# Copy tags from another file |
OlderNewer