Skip to content

Instantly share code, notes, and snippets.

View ahmetozer's full-sized avatar
🖐️
Hi , thank you for visiting.

Ahmet ÖZER ahmetozer

🖐️
Hi , thank you for visiting.
View GitHub Profile
@ahmetozer
ahmetozer / testgist.json
Created August 24, 2020 17:06
testgist
{
"origins" : [
"ahmetozer.org",
"apicors.ahmetozer.org"
],
"hosts" : [
"hub.docker.com"
]
}
@ahmetozer
ahmetozer / docker_repositories_to_html_table.html
Created August 24, 2020 01:32
Embed Docker repositories to your page.
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Description</th>
<th scope="col">Last Update</th>
<th scope="col">Pull Count</th>
</tr>
@ahmetozer
ahmetozer / update-time-cloudflare.sh
Created August 8, 2020 21:54
Update Linux Date Time with curl and Cloudflare
#!/bin/bash
date
date -s"@$(curl ahmetozer.org/cdn-cgi/tracert -s | grep ts= | cut -d"=" -f2 | cut -d"." -f1)"
date
@ahmetozer
ahmetozer / sshd_config
Last active July 14, 2020 21:03
SSH log command
# Do not forget add these lines to /etc/ssh/sshd_config
Match User test
ForceCommand "/bin/sshlogexec.sh"
@ahmetozer
ahmetozer / json-to-list.html
Created June 15, 2020 23:12
Json to bootsrap list example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Json to bootstrap List</title>
<!-- jquery -->
@ahmetozer
ahmetozer / 6to4tunnel.cfg
Created June 5, 2020 11:50
Linux ifupdown 6to4 configuration
#You can get 6to4 adress with below command
#printf "2002:%02x%02x:%02x%02x::1" `curl https://ahmetozer.org/cdn-cgi/tracert -4 -s |grep ip | cut -d"=" -f 2 | tr "." " "`
auto 6to4
iface 6to4 inet6 v4tunnel
address 2002:0808:0808::1 #Do not forget to change own ip in all config.
netmask 48 #
endpoint 192.88.99.1 # Anycast Tunnel Gateway
#gateway 2002:0808:0808::
ttl 255
Usage...
Vcxsrv [:<display>] [option]
:display-number
Vcxsrv runs as the given display-number, which defaults to 0.
To run multiple instances, use unique display-numbers.
-silent-dup-error Do not show fatal exit error mesage box
-a # default pointer acceleration (factor)
-ac disable access control restrictions
@ahmetozer
ahmetozer / Logitech.key.md
Created May 25, 2020 18:07
Logitech K370s/K375s Keys

Input driver version is 1.0.1 Input device ID: bus 0x3 vendor 0x46d product 0x4061 version 0x111 Input device name: "Logitech K370s/K375s" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 1 (KEY_ESC) Event code 2 (KEY_1) Event code 3 (KEY_2) Event code 4 (KEY_3)

@ahmetozer
ahmetozer / check-required-apps.go
Created May 20, 2020 19:15
Golang check required apps
requiredPrograms := []string{"nc", "ls", "bash", "mkdir"}
var requiredapps [4]bool
for i, s := range requiredPrograms {
// Get path of required programs
path, err := exec.LookPath(s)
if err == nil {
fmt.Printf("Required program %v %v found at %v\n", i+1, s, path)
requiredapps[i] = true //save to array
} else {
fmt.Printf("Required program %v %v cannot found.\n", i+1, s)
@ahmetozer
ahmetozer / IPv4-IPv6-domain-regex.go
Last active December 14, 2023 22:28
Ipv4 - IPv6 - domain Regex Golang
ipv6_regex := `^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$`
ipv4_regex := `^(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4})`
domain_regex := `^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$`
match, _ := regexp.MatchString(ipv4_regex+`|`+ipv6_regex+`|`+domain_regex, host)
if match {
fmt.Println("Input is valid")
} else {
fmt.Println("Given input does not match")
re