./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
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
| var http = require("http"), | |
| url = require("url"), | |
| path = require("path"), | |
| fs = require("fs") | |
| port = process.argv[2] || 8888; | |
| http.createServer(function(request, response) { | |
| var uri = url.parse(request.url).pathname | |
| , filename = path.join(process.cwd(), uri); |
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
| <?php | |
| $dir = new FilesystemIterator(__DIR__); | |
| foreach ($dir as $path => $fileinfo) { | |
| if ($fileinfo->isFile()) { | |
| var_dump($path); | |
| } | |
| } |
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 | |
| LINES=$(tput lines) | |
| COLUMNS=$(tput cols) | |
| declare -A snowflakes | |
| declare -A lastflakes | |
| clear |
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
| #!/usr/bin/env php | |
| <?php | |
| function wsse_header($username, $password) { | |
| $nonce = hash_hmac('sha512', uniqid(null, true), uniqid(), true); | |
| $created = new DateTime('now', new DateTimezone('UTC')); | |
| $created = $created->format(DateTime::ISO8601); | |
| $digest = sha1($nonce.$created.$password, true); | |
| return sprintf( |
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 | |
| URL=http://localhost:8080 | |
| ## Unit-Testable Shell Scripts (http://eradman.com/posts/ut-shell-scripts.html) | |
| typeset -i tests_run=0 | |
| function try { this="$1"; } | |
| trap 'printf "$0: exit code $? on line $LINENO\nFAIL: $this\n"; exit 1' ERR | |
| function assert { | |
| let tests_run+=1 |
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
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This can be used to daemonize anything that would normally run in the foreground; I picked Redis. Put this in /etc/systemd/system/redis.service:
[Unit]
Description=Redis
After=syslog.target
[Service]
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
RestartSec=5s