This file contains hidden or 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
# /lib/systemd/system/minecraft.service | |
[Unit] | |
Description=Minecraft Server | |
[Service] | |
Type=forking | |
WorkingDirectory=/home/minecraft | |
User=minecraft | |
Group=minecraft |
This file contains hidden or 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 | |
tmux send-keys -t mcs 'say SERVER SHUTTING DOWN. Saving map...' C-m | |
tmux send-keys -t mcs 'save-all' C-m | |
tmux send-keys -t mcs 'stop' C-m |
This file contains hidden or 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 | |
cd /home/minecraft | |
tmux new -d -s mcs 'java -Xms1G -Xmx7G -d64 -jar spigot-1.8.8-R0.1-SNAPSHOT-latest.jar nogui' | |
tmux detach -s mcs |
This file contains hidden or 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
sudo sh -e ~/Downloads/crouton -t touch,keyboard,unity,extension,chrome -r trusty | |
sudo apt-get install ubuntu-session |
This file contains hidden or 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
/** | |
* Extracts the query parameters from a URL | |
* @url {string} url to be analyzed | |
* @return {string} params object with a property for each named URL query parameter set to the | |
* value of the parameter. | |
*/ | |
function getUrlParams(url) { | |
// Note that a regex should be used to properly split the URL. I.e. an '=' inside a value will be lost | |
// This function is just to demonstrate the usage of Map/Reduce | |
var map = url.slice(url.indexOf('?') + 1).split('&').map(function(param) { return param.split('='); }); |
This file contains hidden or 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 | |
sudo su | |
cd /usr/share/lirc/remotes/ | |
# Make sure to include the trailing slash for the wget command as otherwise you'll be pulling all remotes | |
wget -r --no-parent -nH -R "index.html*" --cut-dir=1 http://lirc.sourceforge.net/remotes/pioneer/ | |
wget -r --no-parent -nH -R "index.html*" --cut-dir=1 http://lirc.sourceforge.net/remotes/panasonic/ | |
wget -r --no-parent -nH -R "index.html*" --cut-dir=1 http://lirc.sourceforge.net/remotes/lexicon/ | |
wget -r --no-parent -nH -R "index.html*" --cut-dir=1 http://lirc.sourceforge.net/remotes/microsoft/ |
This file contains hidden or 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 | |
db2 "connect to sugarult" | |
# Not sure if the following is actually need if the database needs to be restarted | |
# because of the 'currently in use' issues. However it should disconnect all application | |
# connected to the database. | |
db2 "quiesce database immediate force connections" | |
db2 "unquiesce database" |
This file contains hidden or 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 | |
# Since there is no simple drop all tables from a database command in DB2, | |
# this script uses a few unix utilities to accomplish the same result | |
# Note that it assumes that your session is already connected to the database | |
# and that the schema from which you want to drop the tables has the same name | |
# as your current user. | |
db2 "Select 'DROP TABLE', TABLE_NAME from sysibm.tables WHERE TABLE_SCHEMA = UPPER('$USER')" | grep DROP | db2 |
This file contains hidden or 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 | |
# NOTE this creates a default 32k table space which is the maximum. Only a few tables in Sugar need 8k, others need only 4k | |
# However if you are using Studio the table needs enough extra space to add columns | |
# Also note that the specified collation is case insensitive US. By default DB2 is case sensitive. | |
db2 "CREATE DATABASE sugarult USING CODESET UTF-8 TERRITORY US COLLATE USING UCA500R1_LEN_S2 PAGESIZE 32 K" | |
# Sugar 6.4 and 6.5 need the Full Text Search engine up and running and operational. |