Skip to content

Instantly share code, notes, and snippets.

View rayrayndwiga's full-sized avatar

Brian Karani Ndwiga rayrayndwiga

View GitHub Profile
@vigohe
vigohe / drone-istio.yml
Created January 21, 2019 15:53
Drone running on K8 with istio as ingress
apiVersion: v1
kind: Namespace
metadata:
name: drone-test
labels:
istio-injection: enabled
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
@ServinetSC
ServinetSC / SearchPushRow.swift
Last active February 24, 2024 14:35
SearchPushRow for Eureka 4.0.1 (Swift 4)
import Eureka
open class _SearchSelectorViewController<Row: SelectableRowType, OptionsRow: OptionsProviderRow>: SelectorViewController<OptionsRow>, UISearchResultsUpdating where Row.Cell.Value: SearchItem {
let searchController = UISearchController(searchResultsController: nil)
var originalOptions = [ListCheckRow<Row.Cell.Value>]()
var currentOptions = [ListCheckRow<Row.Cell.Value>]()
open override func viewDidLoad() {
@derekp7
derekp7 / gist:9978986
Last active October 13, 2025 14:00
RPC in Bash (rpcsh)

Let's say you have a Bash shell script, and you need to run a series of operations on another system (such as via ssh). There are a couple of ways to do this.

First, you can stage a child script on the remote system, then call it, passing along appropriate parameters. The problem with this is you will need to manually keep the remote script updated whenever you change it -- could be a bit of a challenge when you have something to execute on a number of remote servers (i.e., you have a backup script running on a central host, and it needs to put remote databases in hot backup mode before backing them up).

Another option is to embed the commands you want to run remotely within the ssh command line. But then you run into issues with escaping special characters, quoting, etc. This is ok if you only have a couple commands to run, but if it is a complex piece of Bash code, it can get a bit unwieldy.

So, to solve this, you can use a technique called rpcsh -- rpc in shell script, as follows:

First, place th