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
    
  
  
    
  | # grab 10 lines before & after the pattern | |
| # make sure escape sequences are reained so it looks pretty (that's what the -r flag is for in less) | |
| grep -B 10 -A 10 "error" file.log | less -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
    
  
  
    
  | ... | |
| app.use(function(req, res, next){ | |
| if (app.get('graceful_shutdown') === true) { | |
| res.set('Connection', 'close'); | |
| } | |
| next(); | |
| }); | |
| app.set('graceful_shutdown_start', function() { | 
  
    
      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
    
  
  
    
  | #Allow access to all User-agents: | |
| location /robots.txt {return 200 "User-agent: *\nDisallow:\n";} | |
| #Disallow access to every User-agent: | |
| location /robots.txt {return 200 "User-agent: *\nDisallow: /\n";} | 
  
    
      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
    
  
  
    
  | openssl dhparam -out dhparam.pem 4096 | 
  
    
      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 | |
| # Replace hostname | |
| HOSTNAME=[HOSTNAME HERE] | |
| docker run --detach \ | |
| --hostname $HOSTNAME \ | |
| --publish 443:443 --publish 80:80 --publish 22:22 --publish 9418:9418 \ | |
| --name gitlab \ | |
| --restart always \ | 
  
    
      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 | |
| docker run -d --name gitlab-runner --restart always \ | |
| -v /data/gitlab-runner/config:/etc/gitlab-runner \ | |
| -v /var/run/docker.sock:/var/run/docker.sock \ | |
| gitlab/gitlab-runner:lates | 
  
    
      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
    
  
  
    
  | # Elasticsearch Upstart Script | |
| description "Elasticsearch upstart script" | |
| start on (net-device-up | |
| and local-filesystems | |
| and runlevel [2345] | |
| and startup) | |
| stop on runlevel [016] | 
  
    
      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
    
  
  
    
  | openssl pkcs12 -export -out server.p12 -inkey server.key -in server.crt -certfile CACert.crt | 
  
    
      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 keys = ['apple', 'orange', 'grape', 'banana']; | |
| function gen(keys, type, def) { | |
| var constructor = type.constructor; | |
| var obj = {}; | |
| keys.forEach(function(key) { | |
| obj[key] = typeof constructor === 'function' ? constructor(clone(def)) : undefined; | |
| }); | |
| return obj; | 
  
    
      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
    
  
  
    
  | function isElementInViewport (el) { | |
| //special bonus for those using jQuery | |
| if (typeof jQuery === "function" && el instanceof jQuery) { | |
| el = el[0]; | |
| } | |
| var rect = el.getBoundingClientRect(); | |
| return ( |