Skip to content

Instantly share code, notes, and snippets.

View Onenemanuel's full-sized avatar

Onen Onenemanuel

View GitHub Profile
@Onenemanuel
Onenemanuel / countries.json
Created October 13, 2023 08:58 — forked from devhammed/countries.json
Countries with Name, Dial Code, Emoji Flag and ISO Code
[
{
"name": "Afghanistan",
"flag": "🇦🇫",
"code": "AF",
"dial_code": "+93"
},
{
"name": "Åland Islands",
"flag": "🇦🇽",
@Onenemanuel
Onenemanuel / main.dart
Last active November 22, 2023 10:53
Just a simple challenge here, given a string "uzb034" split it in a way that all truly string characters are capitalized and there spaces after every group of string and numbers, for example given "uzb034" you should return "UZB 034" and given "abc1" return "ABC 1" use any language you want, no regex!!!
void main() {
const text = "234acc";
/// Print formated string
print(generateString(text));
}
String generateString(String text) {
/// Empty string to hold the new string
var textCopy = "";
@Onenemanuel
Onenemanuel / find-pis
Created February 7, 2024 09:09 — forked from danmackinlay/find-pis
Find Raspberry Pi devices on your local networks.
#!/bin/sh
# get broadcast addresses for each network
net=`ifconfig | grep -o -E "Bcast:(.*?) " | cut -f2 -d":"`
# loop over networks running the scan
for n in $net;
do
# first find SSH machines silently to prime the arp table
nmap -T4 -n -p 22 --open --min-parallelism 100 "$n/24" | grep -e "scan report for" -e "ssh" > /dev/null