Skip to content

Instantly share code, notes, and snippets.

View rastislavcore's full-sized avatar
⛓️
NuqneH, nuq?

Rastislav ₡ORE rastislavcore

⛓️
NuqneH, nuq?
View GitHub Profile
@rastislavcore
rastislavcore / ican-validator.ps1
Created March 1, 2024 10:46
Ican Validator on Windows with PowerShell
# Ask for ICAN Address input
$ICAN_ADDRESS = Read-Host "Enter ICAN Address for validation"
$CLEANED_ICAN = $ICAN_ADDRESS.ToUpper().Replace(" ", "")
# Validate format
if (-not $CLEANED_ICAN -match '^(CB|CE|AB)[0-9]{2}[A-F0-9]{40}$') {
Write-Host "Invalid ICAN Address format!"
exit 1
}
@rastislavcore
rastislavcore / ican-validator.sh
Created January 16, 2024 18:25
Executable to validate ICAN addresses for Linux & Mac
#!/bin/bash
read -p "Enter ICAN Address for validation: " ICAN_ADDRESS
CLEANED_ICAN=$(echo $ICAN_ADDRESS | tr '[:lower:]' '[:upper:]')
CLEANED_ICAN=${CLEANED_ICAN//[[:blank:]]/}
if ! [[ $CLEANED_ICAN =~ ^(CB|CE|AB)[0-9]{2}[A-F0-9]{40}$ ]]; then
echo "Invalid ICAN Address format!"
exit 1
fi
@rastislavcore
rastislavcore / github-user-search.html
Last active July 18, 2023 09:03
Search username in all your GitHub projects (limits may apply; Define Token classic and rights: repo:status, repo_deployment, public_repo, repo:invite as GET `token` parameter in URL or fill in into the form.) Use the script mainly locally.
<!DOCTYPE html>
<html>
<head>
<title>GitHub User Search</title>
</head>
<body>
<h1>GitHub User Search</h1>
<form id="searchForm">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
@rastislavcore
rastislavcore / Hacker.terminal
Created June 27, 2023 11:23
MacOS Terminal profile — Hacker
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundAlphaInactive</key>
<real>0.6973314606741573</real>
<key>BackgroundBlurInactive</key>
<real>0.30358146365438954</real>
<key>BackgroundColor</key>
<data>
#!/bin/bash
echo "$(tput setaf 3)●$(tput sgr 0) We will start the script with the SUDO mode! You can stop it and proceed manually if needed."
sudo -v
echo "$(tput setaf 3)●$(tput sgr 0) Stopping the service."
systemctl stop coreverif.service
echo "$(tput setaf 3)●$(tput sgr 0) Disabling the service."
systemctl disable coreverif.service
@rastislavcore
rastislavcore / git-init-core-license.sh
Last active March 19, 2024 19:14
Initiate empty Git repository with CORE License
#!/bin/bash
curl https://raw.githubusercontent.com/bchainhub/core-license/master/LICENSE -o LICENSE
git init
git add LICENSE
git commit -m "CORE License"
git branch -M main
git remote add origin git@github.com:username/repo.git
git push -u origin main
@rastislavcore
rastislavcore / git-init-readme.sh
Created February 2, 2023 16:20
Initiate empty Git repository with the Readme file
#!/bin/bash
echo "# Readme" >> README.md
git init
git add Readme.md
git commit -m "Readme file"
git branch -M main
git remote add origin git@github.com:username/repo.git
git push -u origin main
@rastislavcore
rastislavcore / parsejson.sh
Last active January 27, 2023 11:49
Parse Json with Bash (very simple)
parse_json()
{
echo $1 | \
sed -e 's/[{}]/''/g' | \
sed -e 's/", "/'\",\"'/g' | \
sed -e 's/" ,"/'\",\"'/g' | \
sed -e 's/" , "/'\",\"'/g' | \
sed -e 's/","/'\"---SEPERATOR---\"'/g' | \
awk -F=':' -v RS='---SEPERATOR---' "\$1~/\"$2\"/ {print}" | \
sed -e "s/\"$2\"://" | \

Keybase proof

I hereby claim:

  • I am rastislavcore on github.
  • I am ras (https://keybase.io/ras) on keybase.
  • I have a public key ASBgUEA_LV2bc7ShSQUz5pi0NMa8tYo-7zE5xJNnjVpdtgo

To claim this, I am signing this object:

@rastislavcore
rastislavcore / .gitignore
Last active January 31, 2023 21:37
Most common Gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)