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
// 1. Go to https://auth.quicknode.com/signup | |
// 2. Spin up ethereum, sepolia, or polygon endpoint and add Token/NFT RPC API v2 add-on | |
// 3. npm/yarn install @quicknode/sdk in typescript or javascript project | |
// 4. Copy and paste code in project and replace endpointUrl and wallet value below | |
// 5. profit! | |
import Core from "@quicknode/sdk/core"; | |
(async () => { | |
const core = new Core({ |
# create a new organization $MYORG | |
org = Organization.find_by_name($MYORG) | |
hosts = [] | |
50000.times { hosts << { name: SecureRandom.uuid, organization_id: org.id } } | |
host_ids = ::Host::Managed.import(hosts, validate: false).ids | |
facets = host_ids.map { |id| { host_id: id } } | |
facet_ids = Katello::Host::SubscriptionFacet.import(facets, validate: false).ids |
pushd . | |
FILES=$(find test -type f -path "*$1*"|tr '\n' ' ') | |
echo $FILES | |
bundle exec ruby -Itest $FILES | |
popd |
./test_args.sh "one two" three | |
with $* | |
["one", "two", "three"] | |
with "$@" | |
["one two", "three"] |
This is a basic example of using SOCKS. | |
From the computer you want to browse on you'll make an ssh connection to the computer you want to browse from. | |
In this example it'll be my laptop connecting to my desktop. | |
Run: ssh -D <port, I use 10000> <user>@<hostname of desktop> | |
Now, in a browser you don't normally use (I'm using firefox), go to network proxy. | |
Set Manual porxy configuration |
CERT=/etc/pki/katello/certs/katello-apache.crt | |
KEY=/etc/pki/katello/private/katello-apache.key | |
#create exchange: | |
qpid-config --ssl-certificate $CERT --ssl-key $KEY -b "amqps://localhost:5671" add exchange topic event --durable | |
#view exchange: | |
qpid-config --ssl-certificate $CERT --ssl-key $KEY -b "amqps://localhost:5671" exchanges | |
#create queue: | |
qpid-config --ssl-certificate $CERT --ssl-key $KEY -b 'amqps://localhost:5671' add queue katello_event_queue --durable |
import React, { Component } from 'react'; | |
export default function withPropsChecker(WrappedComponent) { | |
return class PropsChecker extends Component { | |
componentWillReceiveProps(nextProps) { | |
Object.keys(nextProps) | |
.filter(key => { | |
return nextProps[key] !== this.props[key]; | |
}) | |
.map(key => { |
Note that many of these instructions will be katello specific, but will work with slight modifications for foreman or other rails projects.