Skip to content

Instantly share code, notes, and snippets.

View ihcsim's full-sized avatar

Ivan Sim ihcsim

View GitHub Profile
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"image.openshift.io/v1","kind":"ImageStream","metadata":{"annotations":{},"labels":{"app":"battle-demo","app.kubernetes.io/component":"battle-demo","app.kubernetes.io/instance":"battle-demo"},"name":"battle-demo","namespace":"isim-dev"},"spec":{"lookupPolicy":{"local":false},"tags":[{"annotations":{"openshift.io/imported-from":"quay.io/battlecloud/demo:latest"},"from":{"kind":"DockerImage","name":"quay.io/battlecloud/demo:latest"},"generation":2,"importPolicy":{"importMode":"Legacy"},"name":"latest","referencePolicy":{"type":"Source"}}]}}
openshift.io/image.dockerRepositoryCheck: "2023-10-04T15:55:41Z"
creationTimestamp: "2023-10-04T15:55:39Z"
generation: 2
labels:
apiVersion: oadp.openshift.io/v1alpha1
kind: DataProtectionApplication
metadata:
name: oadp-velero
namespace: velero-ppdm
spec:
backupImages: false
configuration:
restic:
enable: false
@ihcsim
ihcsim / curl.yaml
Last active February 13, 2023 18:55
SQLite StatefulSet YAML
apiVersion: v1
kind: Pod
metadata
name: curl
spec:
containers:
- name: curl
image: curlimages/curl:7.87.0
command: ["sleep", "infinity"]
ip netns exec vnet0 tcpdump -X -i veth0 -n tcp -l
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on veth0, link-type EN10MB (Ethernet), capture size 262144 bytes
14:32:23.780478 IP 10.0.2.0.42870 > 10.0.1.0.7096: Flags [F.], seq 538500124, ack 864375556, win 229, options [nop,nop,TS val 3753880662 ecr 2384594272], length 0
0x0000: 4500 0034 cadb 4000 4006 58e9 0a00 0200 E..4..@.@.X.....
0x0010: 0a00 0100 a776 1bb8 2018 dc1c 3385 5304 .....v......3.S.
0x0020: 8011 00e5 1726 0000 0101 080a dfbf ac56 .....&.........V
0x0030: 8e22 0560 .".`
14:32:23.780572 IP 10.0.1.0.7096 > 10.0.2.0.42870: Flags [F.], seq 1, ack 1, win 227, options [nop,nop,TS val 2384621298 ecr 3753880662], length 0
0x0000: 4500 0034 45d9 4000 4006 ddeb 0a00 0100 E..4E.@.@.......
diff --git a/controller/cmd/identity/main.go b/controller/cmd/identity/main.go
index a6b65098..aee02021 100644
--- a/controller/cmd/identity/main.go
+++ b/controller/cmd/identity/main.go
@@ -1,6 +1,7 @@
package identity
import (
+ "context"
"flag"
@ihcsim
ihcsim / flowblade.md
Created May 15, 2019 03:33
Video editing with Flowblade

Video Editing With Flowblade

To install flowblade,

sudo apt install -y flowblade

To add a new video file to the project:

  1. Use the Add button to add the video file
$ cargo run -q
svc: nginx.defaultsvc.cluster.local
use std::collections::HashMap;
#[derive(Debug)]
struct Service {
name: String,
namespace: String,
endpoints: Vec<String>,
mappings: HashMap<String, String>,
}
fn main() {
let str = "hello".to_string();
println!("original: {}\nupdated: {}", str, append_suffix(str));
}
fn append_suffix(s: String) -> String {
s + " world"
}
$ cargo run
Compiling rust-ownership v0.1.0 (/home/isim/rust-ownership)
error[E0382]: use of moved value: `signal`
--> src/main.rs:4:14
|
2 | let signal = "kill".to_string();
| ------ move occurs because `signal` has type `String`, which does not implement the `Copy` trait
3 | loop {
4 | exit(signal)
| ^^^^^^ value moved here, in previous iteration of loop