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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <unistd.h> | |
#include <sys/epoll.h> | |
#define BUFFER_SIZE 256 |
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
#!/bin/bash | |
set -ex | |
CONTROLLER_BUS_ID=0000:00:01.0 | |
DEVICE_BUS_ID=0000:01:00.0 | |
sudo tee /sys/bus/pci/devices/${CONTROLLER_BUS_ID}/power/control <<<on | |
sleep 1 | |
sudo tee /sys/bus/pci/rescan <<<1 |
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
#!/bin/bash | |
set -ex | |
CONTROLLER_BUS_ID=0000:00:01.0 | |
DEVICE_BUS_ID=0000:01:00.0 | |
if sudo lsof /dev/nvidia0 ; then | |
echo 'Some processes are still using the card, aborting.' | |
exit 1 | |
fi |
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
#!/bin/bash | |
# Use the temporary credentials from the MFA profile to update the | |
# registry-creds plugin credentials used to pull images from AWS Elastic | |
# Container Registry | |
# | |
# NOTE: the script won't request fresh credentials, make sure your credentials | |
# are not expired before running this script | |
# retrieve the profile from the credentials file | |
content=$(grep -F -A 5 '[mfa]' < ~/.aws/credentials) |
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
#!/usr/bin/env bash | |
set -eux | |
# used to process output with awk | |
export AWS_DEFAULT_OUTPUT=text | |
disable_cluster_autoscaler() { | |
# delete the tag from the autoscaling group | |
aws autoscaling delete-tags \ | |
--tags ResourceId=$1,ResourceType=auto-scaling-group,Key=k8s.io/cluster-autoscaler/enabled |
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
#!/usr/bin/env ruby | |
require "json" | |
require "aws-sdk-ec2" | |
# Usage: bundle exec ruby find-orphan-pods.rb <cluster-name> | |
# NOTE: make user to point kubectl to the right context! | |
# | |
# Returns a list of pods which aren't using an attached ENI and so don't have | |
# network connectivity |
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
#!/bin/bash | |
SLEEP_TIME=${1:-4m} | |
while true; do | |
if [[ $(qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlaybackStatus) == 'Playing' ]]; then | |
# tell xscreensaver to pretend there has been user activity | |
xscreensaver-command -deactivate | |
fi | |
sleep ${SLEEP_TIME} | |
done |
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
I0526 12:01:28.722410 270 loader.go:242] Config loaded from file /tmp/.kube/config | |
I0526 12:01:28.722930 270 round_trippers.go:264] GET https://192.168.7.60:8443/oapi | |
I0526 12:01:28.722944 270 round_trippers.go:271] Request Headers: | |
I0526 12:01:28.722951 270 round_trippers.go:274] Accept: application/json, */* | |
I0526 12:01:28.722957 270 round_trippers.go:274] User-Agent: oc/v1.1.4 (linux/amd64) openshift/3941102 | |
I0526 12:01:28.722964 270 round_trippers.go:274] Authorization: Bearer jxtjZKCU-3BJG0OhhZvieFfKQw65j2ucisUNNHANGRc | |
I0526 12:01:28.990112 270 round_trippers.go:289] Response Status: 200 OK in 267 milliseconds | |
I0526 12:01:28.990134 270 round_trippers.go:292] Response Headers: | |
I0526 12:01:28.990140 270 round_trippers.go:295] Date: Thu, 26 May 2016 12:01:28 GMT | |
I0526 12:01:28.990146 270 round_trippers.go:295] Content-Length: 93 |