Skip to content

Instantly share code, notes, and snippets.

View rbq's full-sized avatar

rbq

  • Germany, NRW
View GitHub Profile
@superseb
superseb / create_user_and_kubeconfig_rancher2.sh
Last active November 1, 2023 18:51
Create local user and generate kubeconfig in Rancher 2 via API
#!/bin/bash
RANCHERENDPOINT=https://your_rancher_endpoint/v3
# The name of the cluster where the user needs to be added
CLUSTERNAME=your_cluster_name
# Username, password and realname of the user
USERNAME=username
PASSWORD=password
REALNAME=myrealname
# Role of the user
GLOBALROLE=user
require 'securerandom'
class NameGenerator
LEFT = [
"admiring",
"adoring",
"affectionate",
"agitated",
"amazing",
"angry",
@francois-ferrandis
francois-ferrandis / active_admin.rb
Created March 7, 2018 11:59
Customize the active admin layout
# config/initializers/active_admin.rb
# ...rest of the initializer here...
module AdminPageLayoutOverride
def build(*args)
# you can move the call to super at the end, if you wish
# to insert things at the begining of the page
super
@superseb
superseb / rancher_create_kubernetes_token.sh
Last active January 8, 2019 15:01
rancher_create_kubernetes_token.sh
curl 'http://<rancher_server_ip>/v2-beta/apikey' -H 'content-type: application/json' --data-binary '{"type":"apiKey","accountId":"1a1","name":"kubectl","description":"Provides workstation access to kubectl"}' --compressed | jq -r '.publicValue + ":" + .secretValue' | base64 | tr /+ _- | tr -d =
@stubailo
stubailo / apollo-fetch.js
Last active December 1, 2018 15:54
Call a GraphQL API with apollo-fetch
const { createApolloFetch } = require('apollo-fetch');
const fetch = createApolloFetch({
uri: 'https://1jzxrj179.lp.gql.zone/graphql',
});
fetch({
query: '{ posts { title }}',
}).then(res => {
console.log(res.data);
@scottdomes
scottdomes / App.js
Created July 26, 2017 23:02
docs-clone
import React, { Component } from 'react'
import './App.css'
class App extends Component {
state = { text: '' }
componentDidMount() {
window.fetch('http://localhost:3001/notes/1').then(data => {
data.json().then(res => {
this.setState({ text: res.text })
@foklepoint
foklepoint / .gitlab-ci.yml
Created July 8, 2017 20:25
Build and Push images to GCP Container Registry with Gitlab CI
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
GCP_PROJECT_ID: CHANGE-TO-GCP-PROJECT-ID
IMAGE_NAME: image_id
services:
@RaVbaker
RaVbaker / app_proxy.rb
Last active July 20, 2020 08:55
Simple HTTP app Proxy using sinatra
# ENDPOINT="host.com" ruby app_proxy.rb
# curl -i localhost:4567/capture # => "<TIMEOUT>" or regular response every 2 calls
require 'sinatra'
require 'net/http'
$request_settings = { host: ENV["ENDPOINT"] }
$headers = { "Content-Type" => "application/json" }
$counter = 0
@bcardiff
bcardiff / list-deps.cr
Last active April 29, 2024 10:09
List binary dependencies to build a minimal docker image from scratch
unless ARGV.size > 0
puts " Missing executable file argument"
puts " Usage (in a Dockerfile)"
puts " RUN crystal run ./path/to/list-deps.cr -- ./bin/executable"
exit 1
end
executable = File.expand_path(ARGV[0])
unless File.exists?(executable)
@dyscribe
dyscribe / recording-skype-in-a-daw.md
Last active October 11, 2018 01:31
A tutorial on how to record a Skype call in Logic Pro X (or your DAW) on a Mac for free and without any additional hardware.

Use case and assumptions

  • You want to record a Skype call with separate tracks for you and your guest in Logic Pro X (or another DAW) on a Mac without any additional hardware
  • You are willing to use and modify open source software to do it free (there are payed alternatives like https://www.rogueamoeba.com/loopback/)
  • You will end up having a virtual aggregated sound device, that contains the original soundcard you are using plus 2 virtual channels to send and receive Skype audio
  • This tutorial will help you to perform the setup for recording a 1:1 dialogue in Skype on separate tracks. If you want to record several participants you will need to adjust the setup

Prerequisits

Soundflower is no software from an Apple authorized vendor, so you might need to adjust your system preferences, to be able to install software from third party vendors. Here's how to do that: https://www.tekrevue.com/tip/gatekeeper-macos-sierra/