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 <unistd.h> | |
#include <iostream> | |
#include <err.h> | |
int main() { | |
pid_t pid = fork(); | |
std::cerr << getpid() << ": Return value was: " << pid << std::endl; | |
if (pid == -1) err(2, "fork"); | |
if (pid == 0) { | |
// child |
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 | |
# Script for installing tmux on systems where you don't have root access. | |
# tmux will be installed in $HOME/local/bin. | |
# It's assumed that wget and a C/C++ compiler are installed. | |
# exit on error | |
set -e | |
TMUX_VERSION=2.3 |
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
# 1. Get a list of files in the d:\queries folder | |
$FileList = Get-ChildItem -Path d:\queries; | |
# 2. Parse file names, create folder structure, and move files | |
foreach ($File in $FileList) { | |
# Use regular expression to split up file name and assign pieces to field names of $matches | |
$File.Name -match '(?<folder>.*?)(?:_)(?<subfolder>\w{2})(?:_)(?<filename>.*)'; | |
# $matches is a special variable which receives output of the -match operation, see http://www.powershelladmin.com/wiki/Powershell_regular_expressions |