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
# When service supervisor->supermann uses more than 500Mb of RSS, restart it | |
- when: service(supermann).rss > 500Mb, | |
then: restart service supermann | |
# When the first partition has less than 1Gb of space remaining, stop the 'leak' service | |
- when: partition(sda1).space_remaining < 1Gb | |
then: disable service mannhunter |
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
import functools | |
def catch_me_if_you_can(*types): | |
def wrapper(function): | |
@functools.wraps(function) | |
def decorator(*args): | |
try: | |
return function(*args) + amount_to_add | |
except types as e: | |
print("lol", e) |
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
| en | English | English | | |
| en-Scouse | Scouse | Scouse | | |
| en-au | Australian | Australian | | |
| en-lol | LOLCAT | LOLCAT | | |
| en-old | Old English | Englisc | | |
| en-pirate | Pirate | Pirate | | |
| en-tx | Texan | Texan | | |
| cy-GB | Welsh | Cymraeg | |
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
def unforce_ssl | |
if request.ssl? | |
redirect_to protocol: 'http://', port: NON_SSL_PORT | |
end | |
end |
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
bower@1.3.12 node_modules/bower | |
├── is-root@1.0.0 | |
├── junk@1.0.0 | |
├── stringify-object@1.0.0 | |
├── which@1.0.5 | |
├── abbrev@1.0.5 | |
├── chmodr@0.1.0 | |
├── osenv@0.1.0 | |
├── opn@1.0.0 | |
├── archy@0.0.2 |
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
def ijz(x, y): | |
x = str(x) | |
for i in range(len(x)): | |
n = int(x[i:]) | |
if n < y: | |
return n | |
assert ijz(12345, 50) == 45 | |
assert ijz(123789, 50) == 9 |
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
$ sudo aptitude remove cowsay | |
The following packages will be REMOVED: | |
cowsay | |
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded. | |
Need to get 0 B of archives. After unpacking 90.1 kB will be freed. | |
The following packages have unmet dependencies: | |
mint-meta-core : Depends: cowsay but it is not going to be installed. | |
mintsystem : Depends: cowsay but it is not going to be installed. | |
The following actions will resolve these dependencies: |
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
>>> [].flatten! | |
=> nil | |
>>> [[1], [2]].flatten! | |
=> [1, 2] | |
>>> [[1]].flatten! | |
=> [1] | |
>>> [[]].flatten! | |
=> [] | |
>>> [].flatten! | |
=> nil |
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
bower@1.3.8 /usr/local/lib/node_modules/bower | |
├── is-root@0.1.0 | |
├── junk@0.3.0 | |
├── stringify-object@0.2.1 | |
├── which@1.0.5 | |
├── abbrev@1.0.5 | |
├── chmodr@0.1.0 | |
├── osenv@0.1.0 | |
├── opn@0.1.2 | |
├── archy@0.0.2 |
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
❯ ./set_ulimit.sh | |
14569 unlimit: 1024 | |
14569 unlimit: 69 | |
14569 unlimit: 69 (exec) |