$ uname -r
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
| [Unit] | |
| Description=Keeps a tunnel to 'remote.example.com' open | |
| After=network.target | |
| [Service] | |
| User=autossh | |
| # -p [PORT] | |
| # -l [user] | |
| # -M 0 --> no monitoring | |
| # -N Just open the connection and do nothing (not interactive) |
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
| Follow the WORKAROUND: | |
| 1. Add a comand to /etc/rc.local, add the following line above "exit 0": | |
| setpci -s 00:1c.2 0x50.B=0x41 | |
| 2. Add the same comand to /etc/apm/resume.d/21aspm (which does not exist yet): | |
| setpci -s 00:1c.2 0x50.B=0x41 | |
| 3. Add the following to /etc/modprobe.d/sdhci.conf: | |
| options sdhci debug_quirks2=4 | |
| 4. Re-generate initrd: | |
| sudo update-initramfs -u -k all | |
| 5. Reboot or reload sdhci module: |
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 | |
| IMAGE="gcr.io/google-containers/ubuntu-slim:0.14" | |
| COMMAND="/bin/bash" | |
| SUFFIX=$(date +%s | shasum | base64 | fold -w 10 | head -1 | tr '[:upper:]' '[:lower:]') | |
| usage_exit() { | |
| echo "Usage: $0 [-c command] [-i image] PVC ..." 1>&2 | |
| exit 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
| #!/bin/sh | |
| EXPECTED_SIGNATURE=$(curl -sS https://composer.github.io/installer.sig) | |
| php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
| ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") | |
| if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] | |
| then | |
| >&2 echo 'ERROR: Invalid installer signature' | |
| rm composer-setup.php |
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 | |
| # | |
| # rotate_desktop.sh | |
| # | |
| # Rotates modern Linux desktop screen and input devices to match. Handy for | |
| # convertible notebooks. Call this script from panel launchers, keyboard | |
| # shortcuts, or touch gesture bindings (xSwipe, touchegg, etc.). | |
| # | |
| # Using transformation matrix bits taken from: | |
| # https://wiki.ubuntu.com/X/InputCoordinateTransformation |
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 | |
| docker images --format '{{.Size}}\t{{.Repository}}:{{.Tag}}\t{{.ID}}' | sort -h | column -t |
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 connection = require('amqp').createConnection({host: 'localhost'}); | |
| connection.on('ready', function() { | |
| // create a temporary queue by passing an empty string as the queue name | |
| var queue = connection.queue('', function(queue) { | |
| console.log('connected to ' + queue.name); | |
| // bind the queue to all messages on the amq.rabbitmq.log topic exchange | |
| queue.bind('amq.rabbitmq.log', '#'); |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
The php-apcu-bc package provides a backwards compatibility layer from apcu -> apc, and is reuqired for some older PHP code bases (e.g. Yii 1). The package is not (yet) available in the Ubuntu 16.04 repos. To install it, use php-pear:
sudo apt-get install php-dev php-pear
sudo pecl install apcu_bc-betaThen edit /etc/php/7.0/apache2/php.ini and add the following at the end of the file:
NewerOlder