Skip to content

Instantly share code, notes, and snippets.

View aggresss's full-sized avatar
♾️
kata

Jagger Yu aggresss

♾️
kata
View GitHub Profile
# SSH Agent Functions
# Mark Embling (http://www.markembling.info/)
#
# How to use:
# - Place this file into %USERPROFILE%\Documents\WindowsPowershell (or location of choice)
# - Import into your profile.ps1:
# e.g. ". (Resolve-Path ~/Documents/WindowsPowershell/ssh-agent-utils.ps1)" [without quotes]
# - Enjoy
#
# Note: ensure you have ssh and ssh-agent available on your path, from Git's Unix tools or Cygwin.
@MartinMReed
MartinMReed / openssl_server.c
Last active December 29, 2022 17:19
OpenSSL Server, Reference Example
#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <string>
#include <sys/socket.h>
#include <netinet/in.h>
#define IP_ADDR INADDR_ANY
@daurnimator
daurnimator / webrtc.js
Last active September 27, 2024 10:04
Playing with WebAudio and WebRTC
// Browser compat
window.AudioContext = window.AudioContext || window.webkitAudioContext;
window.RTCPeerConnection = window.RTCPeerConnection || window.webkitRTCPeerConnection || window.mozRTCPeerConnection;
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia;
var key = window.location.hash.substring(1);
var audio_context = new AudioContext();
var local_output = audio_context.createMediaStreamDestination();
@CarlEkerot
CarlEkerot / ssl_bio.c
Created January 14, 2016 15:35
SSL BIO example
#include <openssl/ssl.h>
/**
* This example demonstrates how to set up a simple SSL BIO filter on an
* existing connect BIO. This is useful in sutiations where cleartext
* communication is upgraded to ciphertext communication.
*
* Compile with:
* gcc ssl_bio.c -lcrypto -lssl -o ssl_bio
*/
@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active November 12, 2024 14:24
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf [email protected]:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."[email protected]:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
import React, { ReactDOM, Component, PropTypes } from 'react';
import {render} from 'react-dom';
import { Router, Route, Link, browserHistory} from 'react-router'
/** React router hello world example **/
class App extends Component {
render() {
@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active November 14, 2024 08:31
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

kubectl run myubuntu --image ubuntu --rm -ti --restart=Never --overrides='
{
"metadata": {
"labels": {
"diditwork": "itdid"
}
},
"spec": {
"containers": [
{