Make sure hub is installed and set up with your user credentials.
./update-gem.sh loofah "Resolves security vulnerability."Make sure hub is installed and set up with your user credentials.
./update-gem.sh loofah "Resolves security vulnerability."| #!/usr/bin/env bash | |
| RUBOCOP_CONF="$1" | |
| cat "$RUBOCOP_CONF" | \ | |
| sed -e 's|^DuplicatedGem|Bundler/DuplicatedGem|g' | \ | |
| sed -e 's|^InsecureProtocolSource|Bundler/InsecureProtocolSource|g' | \ | |
| sed -e 's|^OrderedGems|Bundler/OrderedGems|g' | \ | |
| sed -e 's|^DuplicatedAssignment|Gemspec/DuplicatedAssignment|g' | \ | |
| sed -e 's|^OrderedDependencies|Gemspec/OrderedDependencies|g' | \ | |
| sed -e 's|^RequiredRubyVersion|Gemspec/RequiredRubyVersion|g' | \ |
Create a file production that includes the server hostnames of production servers.
Then call for instance:
./run_on.sh production 'tail -f /var/log/nginx/access.log'
| #!/usr/bin/env bash | |
| if [[ "$TERM_PROGRAM" = "vscode" ]] | |
| then | |
| code --reuse-window --wait "$@" | |
| else | |
| code --new-window --wait "$@" | |
| fi |
Use the following to generate gemset.nix:
nix run nixpkgs.bundix --command bundixThen run:
nix-shell| these derivations will be built: | |
| /nix/store/30fribf3xpmiivys1mzqp007m70p4h4v-node-v11.0.0.tar.xz.drv | |
| /nix/store/k1ww35ij6c9r0vxxrqpmid1lpmhpq3zm-nodejs-11.0.0.drv | |
| these paths will be fetched (95.06 MiB download, 553.67 MiB unpacked): | |
| /nix/store/0ingn8cwwnl84i374hcl6nafsm2c5m2p-perl-5.28.0 | |
| /nix/store/0pcxv5mzn1fz7z8aa1frczkm4gpy7dkc-libgcrypt-1.8.3 | |
| /nix/store/10yq7kwlvbc6h658izmrlsspry1g9f3c-gcc-wrapper-7.3.0 | |
| /nix/store/1vb4m694aj9bdm7aq3911yjjb73gn4ii-attr-2.4.47 | |
| /nix/store/22zwmxhd41a1j3cf7rxjwd75w4hmxdrv-libev-4.24 | |
| /nix/store/2brlr94ahy3a9mvcjy0qbqpv8zrb7b7s-python-2.7.15 |
This script is handy for setting up an ad-hoc DHCP server for instance when starting up a Raspberry PI for the first time.
dnsmasq will output when it has given a client an address:
dnsmasq-dhcp: DHCPACK(enp0s25) 192.169.1.109 b8:27:eb:86:2f:ed nixos
This is an example how to do GraphQL queries in a somewhat sane way in bash using curl and jq.
The example does an query towards GitHub to fetch the commit SHAs of open pull requests for a specific repository.
The example needs the environment variables REPO_OWNER, REPO_NAME and GITHUB_TOKEN to be set.
| local function matches(input, pattern) | |
| local index = 1 | |
| return function() | |
| local match = input:match(pattern, index) | |
| if match then | |
| index = index + match:len() + 1 | |
| return match | |
| else | |
| return nil | |
| end |