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
// Convert a struct sockaddr address to a string, IPv4 and IPv6: | |
char *get_ip_str(const struct sockaddr *sa, char *s, size_t maxlen) | |
{ | |
switch(sa->sa_family) { | |
case AF_INET: | |
inet_ntop(AF_INET, &(((struct sockaddr_in *)sa)->sin_addr), | |
s, maxlen); | |
break; |
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 | |
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s", | |
//\u000A\u002F\u002A | |
class PhpJava { | |
static function main() { | |
echo(//\u000A\u002A\u002F | |
"Hello World!"); | |
}} | |
//\u000A\u002F\u002A | |
PhpJava::main(); |
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
#include <openssl/ssl.h> | |
/** | |
* This example demonstrates how to set up a simple SSL BIO filter on an | |
* existing connect BIO. This is useful in sutiations where cleartext | |
* communication is upgraded to ciphertext communication. | |
* | |
* Compile with: | |
* gcc ssl_bio.c -lcrypto -lssl -o ssl_bio | |
*/ |
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
Host * | |
ControlMaster auto | |
ControlPath /home/dave/.ssh/sockets/%r@%h-%p | |
ControlPersist 8760h | |
ServerAliveInterval 5 | |
ServerAliveCountMax 1 | |
Host *.mun.ca | |
User dave | |
IdentityFile /home/dave/.ssh/keymun |
This is a guide on how to email securely.
There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.
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 | |
version=1.0.1 | |
versionDate="2014-02-14" | |
function showHelp() { | |
echo "watchfile - monitor file(s)/command and perform action when changed | |
Possible ways of usage | |
---------------------------------------- |
This article is now published on my website: A one-off git repo server.
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
PROJECTS_DIR=$HOME/projects | |
function workon { | |
cd $PROJECTS_DIR/"$1"/; | |
cd "$1" > /dev/null 2>&1 && source ../bin/activate > /dev/null 2>&1; | |
} | |
complete -W '`ls $PROJECTS_DIR`' workon |