Use the following configuration in Apache's httpd.conf file or within a virtual host configuration. Note that you should set DocumentRoot
and ServerName
fit to your environment:
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
INPUT=$1 | |
TIMESTAMP=`date +%Y-%m-%d-%H-%M-%S` | |
ARCHIVE_NAME=${INPUT}-${TIMESTAMP}.zip | |
mkdir -p build | |
cd $LAMBDA | |
zip -r $ARCHIVE_NAME . | |
mv $ARCHIVE_NAME ../build/ | |
cd .. |
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
@echo off | |
goto comment | |
Author: Code Monk | |
Description: This file use to backup the database using PostgreSQL backup utility "pg_dump". | |
Backup parameters should be setup before executing this file | |
File Format flags : | |
c = Custom | |
t = Tar |
Edit: This list is now maintained in the rust-anthology repo.
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 | |
set -euo pipefail | |
IFS=$'\n\t' | |
CARGO_WEB_RELEASE=$(curl -L -s -H 'Accept: application/json' https://github.com/koute/cargo-web/releases/latest) | |
CARGO_WEB_VERSION=$(echo $CARGO_WEB_RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/') | |
CARGO_WEB_URL="https://github.com/koute/cargo-web/releases/download/$CARGO_WEB_VERSION/cargo-web-x86_64-unknown-linux-gnu.gz" | |
echo "Downloading cargo-web from: $CARGO_WEB_URL" |
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
alias c="cargo" | |
alias ci="cargo init" | |
alias cib="cargo init --bin" | |
alias cn="cargo new" | |
alias cnb="cargo new --bin" | |
alias cc="cargo check" | |
alias cca="cargo check --all-targets" | |
alias cb="cargo build" | |
alias cbr="cargo build --release" |
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 | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out myssl.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key myssl.key -out myssl.csr | |
echo "Removing passphrase from key (for nginx)..." | |
cp myssl.key myssl.key.org | |
openssl rsa -in myssl.key.org -out myssl.key |
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
struct Color { | |
red: u8, | |
green: u8, | |
blue: u8 | |
} | |
fn main() { | |
let mut link_color = Color {red: 0,green: 0,blue: 255}; | |
link_color.blue = 238; | |
println!("Link Color = rgb({}, {}, {})", link_color.red, link_color.green, link_color.blue); //Link Color = rgb(0, 0, 238) |
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
use std::collections::VecDeque; | |
fn main() { | |
let num = 1970; | |
let mut buf: VecDeque<_> = num.to_string().chars().map(|d| d.to_digit(10).unwrap()).collect();; | |
for _ in 0..buf.len() { | |
println!("{:?}", buf); | |
let n = buf.pop_front().unwrap(); | |
buf.push_back(n); | |
} | |
} |
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
use std::ops::Shr; | |
#[derive(PartialEq, Debug)] | |
struct SpinVector<T: Clone> { | |
vec: Vec<T>, | |
} | |
impl<T: Clone> Shr<usize> for SpinVector<T> { | |
type Output = Self; |
NewerOlder