Skip to content

Instantly share code, notes, and snippets.

@vincentchalamon
vincentchalamon / fixInterfaceScope.sh
Last active June 28, 2022 08:39
Fix SNX interface scope
fixInterfaceScope() {
interface=tunsnx
data=($(ip -o address show "$interface" | awk -F ' +' '{print $4 " " $6 " " $8}'))
LOCAL_ADDRESS_INDEX=1
PEER_ADDRESS_INDEX=2
SCOPE_INDEX=3
if [ "${data[$SCOPE_INDEX]}" = "global" ]
then
echo "Interface ${interface} is already set to global scope. Skip!"
return
if command
`file "wykaz_stacji.csv"`
returns `wykaz_stacji.csv: Non-ISO extended-ASCII text, with CRLF line terminators`
try one of below commands
`recode CP1250..utf8 <x.txt >x.utf8.txt`
`iconv -f CP1250 -t UTF-8 <x.txt >x.utf8.txt`
@StevenACoffman
StevenACoffman / opa-vs-casbin.md
Last active July 18, 2024 15:27
OPA vs Casbin

Information in this Gist originally from this github issue, which is outdated.

As @RomanMinkin mentioned, you can also consider Casbin (https://github.com/casbin/casbin). It is the most starred authorization library in Golang. There are several differences between Casbin and OPA.

Feature Casbin OPA
Library or service? Library/Service Library/Service
How to write policy? Two parts: model and policy. Model is general authorization logic. Policy is concrete policy rule. A single part: Rego
RBAC hierarchy Casbin supports role hierarchy (a role can have a sub-role) Role hierarchies can be encoded in data. Also with the new graph.reachable() built-in function queries over those hierarchies are much more feasible now.
RBAC separation of duties Not supported Supported: two roles cannot be assigned together
@vincentchalamon
vincentchalamon / .gitignore
Last active September 11, 2024 15:30
Gitignore global
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #