Skip to content

Instantly share code, notes, and snippets.

View osmanmakal's full-sized avatar
🎯
Focusing

Osman Makal osmanmakal

🎯
Focusing
View GitHub Profile
#!/bin/bash
# KULLANIM
# bash esxi-scan.sh 195.175.33.0/24
#
input=$1
net=$(echo $input | cut -d '/' -f 1)
prefix=$(echo $input | cut -d '/' -f 2)
if (($prefix != 24))
then
echo "sadece /24"
@osmanmakal
osmanmakal / verify-cpanel-license.php
Last active March 19, 2022 19:50
It allows you to check whether there is an original license for the web hosting service you purchased.
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://myip.cpanel.net/v1.0/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$addr = curl_exec($curl);
curl_close($curl);
header('Location: https://verify.cpanel.net/app/verify?ip='.$addr, true, 303);
exit;
@osmanmakal
osmanmakal / maintenance.lua
Created April 17, 2020 13:37
Sample maintenance work file prepared for Lua supported Nginx. You can customize it as you like.
-- Sample maintenance work file prepared for Lua supported Nginx. You can customize it as you like.
-- Note: It works within websites that work with
-- services such as Reverse proxy and CloudFlare,
-- and you can create a special article or html
-- page by changing ngx.exit(ngx.HTTP_FORBIDDEN)
local whitelist = {
"192.168.1.2",
"192.168.1.3",
@osmanmakal
osmanmakal / main.go
Last active October 6, 2019 02:26
xxHash 64bit usage example in golang
package main
import (
"fmt"
"hash"
"io"
"os"
"github.com/pierrec/xxHash/xxHash64"
)
@osmanmakal
osmanmakal / valid-interface.go
Created June 26, 2018 21:40
How to determine an interface{} value type and existing values
package main
import (
"fmt"
"reflect"
)
// How to determine an interface{} value type and existing values...
func main() {
value := make(map[string]interface{})
value["dogru"] = string("hebele, hübele")
@osmanmakal
osmanmakal / remoteip.go
Created May 21, 2018 12:02
Remote IP Address with Go (X-Real-Ip and X-Forwarded-For included)
package lib
import (
"net"
"net/http"
"strings"
)
func GetIPAddr(r *http.Request) string {
ipaddr, _, _ := net.SplitHostPort(r.RemoteAddr)
@osmanmakal
osmanmakal / beego.sh
Last active March 16, 2023 13:23
bee go supervisor script
#!/bin/bash
################## Supervisor ##################
# [program:repo]
# command=bash -c /go/src/repo/start.sh
# directory=/root
# autostart=true
# autorestart=true
# stderr_logfile=/var/log/repo-err.log
# stdout_logfile=/var/log/repo-out.log
# environment=GOPATH="/go"
@osmanmakal
osmanmakal / raven-shell
Created December 4, 2016 00:36 — forked from barroco/raven-shell
Send Sentry error from shell using curl
#!/bin/sh
SENTRY_KEY=
SENTRY_SECRET=
SENTRY_PROJECTID=1
SENTRY_HOST=sentry.example.com
SCRIPT_ARGUMENTS=$@
capture_error()
{