Some bits and pieces of useful commands for working with k8s
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
# Example of how to keep a container running long enough to `exec` into it | |
# https://stackoverflow.com/a/40605238/3198973 | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: some-deployment | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: |
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
//! Example implementation of a different way than interrupt::free to provide a critical section. | |
//! | |
#![no_main] | |
#![no_std] | |
extern crate panic_halt; | |
use cortex_m::peripheral::syst::SystClkSource; | |
use cortex_m::Peripherals; | |
use cortex_m_rt::{entry, exception}; |
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
function Delete-MergedBranches() { | |
Foreach($branch in (git branch --merged master | Select-String ".*master" -NotMatch)) { | |
git branch -d $branch.ToString().Trim() | |
} | |
} |
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
Get-Package | Select-Object Id,LicenseUrl | Out-File -FilePath .\licenses.txt | |
Get-Package | Select-Object LicenseUrl | Get-Unique -AsString | Out-File .\unique-licenses.txt |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// Run in the Jenkins script console | |
// https://stackoverflow.com/questions/37683143/extract-passphrase-from-jenkins-credentials-xml | |
// file containing value without surrounding curly braces | |
File file = new File("/path/to/file.txt") | |
hudson.util.Secret.decrypt("{${file.text}}") | |
// file with value including curly braces | |
File file = new File("/path/to/file.txt") | |
hudson.util.Secret.decrypt(file.text) |
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
# https://github.com/moby/moby/issues/33794#issuecomment-380969582 | |
docker exec -e COLUMNS="`tput cols`" -e LINES="`tput lines`" -ti ${container_id} bash |
I hereby claim:
- I am rubberduck203 on github.
- I am rubberduck (https://keybase.io/rubberduck) on keybase.
- I have a public key whose fingerprint is 4694 3059 BD59 9381 A0CA 7DC1 0CA0 302F A9DF BEAA
To claim this, I am signing this object:
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
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ | |
"key": "shift+alt+t", | |
"command": "workbench.action.tasks.test" | |
}, | |
{ | |
"key":"alt+cmd+[ArrowDown]", | |
"command": "workbench.action.terminal.focusNext", | |
"when": "terminalFocus" |
NewerOlder