Skip to content

Instantly share code, notes, and snippets.

@svx
svx / delete-evicted-pods-all-namespaces.sh
Created August 15, 2018 12:45 — forked from psxvoid/delete-evicted-pods-all-namespaces.sh
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
#!/bin/sh
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d
# delete all evicted pods from all namespaces
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff state from all namespaces
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces
@ataylorme
ataylorme / books-cpt-metabox.php
Last active April 17, 2024 17:27
Books WordPress REST API Example
<?php
function register_books_cpt() {
$args = array(
'labels' => array(
'name' => _x( 'Books', 'post type general name' ),
'singular_name' => _x( 'Book', 'post type singular name' ),
),
'description' => '',
'hierarchical' => false,
@indraniel
indraniel / tar-gz-reader.go
Created February 23, 2015 19:05
Reading through a tar.gz file in Go / golang
package main
import (
"archive/tar"
"compress/gzip"
"flag"
"fmt"
"io"
"os"
)
@sandyxu
sandyxu / rbenv-install-and-using.md
Last active March 21, 2024 06:23
使用 rbenv 安装和管理Ruby版本

常用的几个 Ruby 版本管理工具有:rvmrbenv,ry,rbfu。rvm 应该是最早出现、使用最多的,因为过于强大以至于违背了某个 Linux 软件开发原则,所以出现了很多轻便的替代者,其中来自 37signals 的 rbenv 就很受欢迎。ry 和 rbfu 看上去更轻便,不过使用不广泛。之前使用过rvm, 这次尝试下rbenv。

我的环境是 Ubuntu14.04

1. 安装 rbenv

rbenv的源代码托管在github,在终端中,从 github 上将 rbenv 源码 clone 到本地,然后设置 $PATH。

git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' &gt;&gt; ~/.bashrc