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 | |
mkdir /tmp/magick_tmp | |
MAGICK_TMPDIR=/tmp/magick_tmp | |
export MAGICK_TMPDIR | |
LECTURENOTESDIR=/home/ec2-user/Dropbox/LectureNotes/ | |
cd $LECTURENOTESDIR | |
process_directory() { |
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 | |
# exit on error | |
set -e | |
# Description: | |
# - Linux-compatible alternative to the official Bing Wallpaper client (https://www.microsoft.com/en-us/bing/bing-wallpaper). | |
# - Downloads the current Bing wallpaper of the day directly. | |
# - Fetches the matching image description / copyright information and overlays it onto the image using ImageMagick. | |
# |
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 | |
# Original author: https://gist.github.com/PaulMaddox/9210543 | |
# Requires cli53 to be installed | |
# https://github.com/barnybug/cli53 | |
DNS_NAME="home"; | |
DNS_ZONE="example.com"; | |
# not needed, we have a ~/.boto file |
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 | |
dig +short @resolver1.opendns.com myip.opendns.com |
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
// Copyright 2016 Jeremie Miserez <jeremie@miserez.org> | |
// | |
// MIT License | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O |
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 | |
# reliable way to get the directory where this file is stored | |
SCRIPT=$(readlink -f $0) | |
export SCRIPTPATH=`dirname $SCRIPT` | |
SCRIPTNAME=$(basename "$SCRIPT") | |
if [ "$#" -lt 1 ] | |
then | |
echo "Usage: ./$SCRIPTNAME <root folder path> [<pattern for matching directories within root directory, default is \"*\">]" | |
echo "or ./$SCRIPTNAME -i <single directory path to process>" |
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 | |
# Original idea: http://superuser.com/a/784102/59125 | |
pidtree(){ | |
pids_for_ppid=() | |
while read pid ppid; do | |
pids_for_ppid[$ppid]+=" $pid" | |
done < <(ps -e -o pid,ppid --no-headers) |
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 | |
# | |
# xenvm_backup_encrypted.sh | |
# | |
# Author: Jeremie Miserez <jeremie@miserez.org> | |
# Latest version: https://gist.github.com/jmiserez/f7771d0c82455128839d | |
# | |
# This script will: | |
# 1. Connect to a remote XenServer server over SSH | |
# 2. Shutdown the specified VM |
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 | |
# | |
# xenvm_decrypt_backup.sh | |
# | |
# Author: Jeremie Miserez <jeremie@miserez.org> | |
# Latest version: https://gist.github.com/jmiserez/11a8aafeee9256645ac5 | |
# | |
# This script will decrypt encrypted images generated by xenvm_backup_encrypted.sh, | |
# (https://gist.github.com/jmiserez/f7771d0c82455128839d), when given a .key.enc file | |
# and if all related files are in the same directory as the .key.enc file. |
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
/* | |
* vm.c - Simple X86 interpreter | |
* | |
* Copyright (c) 2013, Jeremie Miserez <jeremie@miserez.org> | |
*/ | |
/* | |
* Highlights/Features not specified in assignment | |
* =============================================== | |
* - Memory simulation of all 4GB with paging |
OlderNewer