Skip to content

Instantly share code, notes, and snippets.

View simar7's full-sized avatar

simar7

  • Canada
View GitHub Profile
@simar7
simar7 / gist:3578eefa18b8883006e70cf6b2ed1f68
Created May 4, 2020 22:46
difference between 1.0 and 1.1 NVD JSON feed
diff
3,4c3,4
< "title": "JSON Schema for NVD Vulnerability Data Feed version 1.0",
< "id": "https://scap.nist.gov/schema/nvd/feed/1.0/nvd_cve_feed_json_1.0.schema",
---
> "title": "JSON Schema for NVD Vulnerability Data Feed version 1.1",
> "id": "https://scap.nist.gov/schema/nvd/feed/1.1/nvd_cve_feed_json_1.1.schema",
14a15,17
> },
@simar7
simar7 / main.go
Created November 18, 2019 21:04
pipe + tee with go
package main
import (
"fmt"
"io"
"io/ioutil"
"strings"
"sync"
)
@simar7
simar7 / gist:6b0de1fe54f4c1edc544df9939e7a635
Created November 2, 2019 00:08
State of eBPF with Go
State of eBPF with Go
Available eBPF program types that are supported by various go bindings:
Kernel reference for all types: https://github.com/torvalds/linux/blob/master/include/uapi/linux/bpf.h#L149
- BPF_PROG_TYPE_PERF_EVENT
- Attach and instrument software and hardware perf events
- E.g. Syscalls, timers (and expiration), sampling of hardware events
- Gobpf from iovisor: https://github.com/iovisor/gobpf
---
apiVersion: batch/v1
kind: Job
metadata:
name: kube-bench
spec:
template:
metadata:
labels:
app: kube-bench

Keybase proof

I hereby claim:

  • I am simar7 on github.
  • I am simar (https://keybase.io/simar) on keybase.
  • I have a public key ASA2_olLsvxrgpubn-1UWSRkcoiSrdZtzD0j6RR6_w4I9Qo

To claim this, I am signing this object:

➜ ~ pip install osxmpdkeys
Collecting osxmpdkeys
Collecting argparse (from osxmpdkeys)
Using cached argparse-1.4.0-py2.py3-none-any.whl
Collecting osxmmkeys>=0.0.4 (from osxmpdkeys)
Collecting python-mpd2>=0.5 (from osxmpdkeys)
Collecting pyobjc (from osxmmkeys>=0.0.4->osxmpdkeys)
Collecting pyobjc-framework-ScreenSaver==3.1.1 (from pyobjc->osxmmkeys>=0.0.4->osxmpdkeys)
Collecting pyobjc-framework-InputMethodKit==3.1.1 (from pyobjc->osxmmkeys>=0.0.4->osxmpdkeys)
Collecting pyobjc-framework-WebKit==3.1.1 (from pyobjc->osxmmkeys>=0.0.4->osxmpdkeys)
@simar7
simar7 / db.go
Created December 28, 2015 19:51 — forked from trkrameshkumar/db.go
Get get number of rows using sql in golang
package main
import (
"database/sql"
"fmt"
_ "github.com/lib/pq"
)
const (
DB_USER = "ramesh"
@simar7
simar7 / yosemite-sound-issues.md
Created December 1, 2015 23:45 — forked from mdwheele/yosemite-sound-issues.md
Fix Yosemite Bluetooth Sound Issues
  1. Run the following in your terminal.
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool Min (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 80
// Sort the ArrayList of ArrayList in reverse order by degree.
for (List<Integer> vertex : sortedAdjList) {
Collections.sort(vertex);
}
Collections.sort(sortedAdjList, new Comparator<ArrayList<Integer>>() {
@Override
public int compare(ArrayList<Integer> x1, ArrayList<Integer> x2) {
return x2.size().compareTo(x1.size());
}
});
# -*- coding: utf-8 -*-
import numpy as np
import igraph as ig
class BasicNode: #should be interfaced to from a graph object
def __init__(self, content=None, labels=None):
self.content = content
self.incident_edges =set([])
self.incident_outward_edges=set([])
self.incident_inward_edges=set([])