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
| Copyright (c) 2016 Jens Bissinger | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style type="text/css" media="screen"> | |
| * { | |
| overflow: hidden; | |
| font-family: "Helvetica Neue"; | |
| cursor: pointer; | |
| text-selection: none; | |
| } |
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
| kind: Namespace | |
| apiVersion: v1 | |
| metadata: | |
| name: demo | |
| labels: | |
| name: demo | |
| --- | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: |
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
| daemon off; | |
| error_log /dev/stderr warn; | |
| worker_processes 4; | |
| events { | |
| worker_connections 1024; | |
| multi_accept on; | |
| } |
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 | |
| USER=admin | |
| PASS=a | |
| rabbitmqadmin -u "$USER" -p "$PASS" list queues | grep -oP "amq.gen-[\w\-]+" |
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 python3 | |
| ''' | |
| Rename computer from remote CSV using Jamf binary | |
| Pass in the URL to your remote CSV file using script parameter 4 | |
| The remote CSV could live on a web server you control, OR be a Google Sheet | |
| specified in the following format: | |
| https://docs.google.com/spreadsheets/u/0/d/<document ID>/export?format=csv&id=<document ID>&gid=0 | |
| ''' | |
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
| drush php-eval "module_load_install('MYMODULE'); MYMODULE_update_NUMBER();" | |
| # or | |
| drush php:cli | |
| require 'core/modules/taxonomy/taxonomy.post_update.php'; | |
| taxonomy_post_update_add_unpublished_nodes_to_taxonomy_index($sandbox); |
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 ruby | |
| # Modify all values of an array the same way | |
| # Do you often see code like this? | |
| puts [0.3, 0.5, 0.7].map{|float| float.round} # [0, 1, 1] | |
| # We can do better! | |
| puts [0.3, 0.5, 0.7].map(&:round) # [0, 1, 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/bash | |
| export AWS_ACCESS_KEY_ID= | |
| export AWS_SECRET_ACCESS_KEY= | |
| export AWS_DEFAULT_REGION= | |
| buckets_wsv=$(aws s3api list-buckets --query "Buckets[].Name" --output text) | |
| echo $buckets_wsv | |
| echo | |
| echo "---" |
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
| # How to convert IPv4 addresses between integer <=> dot-decimal notation | |
| INTEGER = 1698212032 | |
| DOT_DECIMAL = '192.168.56.101' | |
| # [ 192, 168, 56, 101 ] | |
| DOT_DECIMAL_PARTS = DOT_DECIMAL.split('.').map(&:to_i) | |
| #################################### | |
| # integer to dot-decimal |
NewerOlder