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 / apt-clear.sh
Created October 11, 2020 11:40
Clear APT after installation
apt autoremove --purge
apt clean
find /var/lib/apt/lists/ -maxdepth 1 -type f -print0 | xargs -0 rm
@ahmetozer
ahmetozer / Dockerfile
Last active October 11, 2020 13:00
vscode web Docker File
FROM debian:latest as dapt
RUN apt update
FROM dapt as dockerclient
RUN apt install docker.io -y
FROM dapt as vscode
RUN apt install curl net-tools bash-completion -y && \
curl -fsSL https://code-server.dev/install.sh | sh ;\
apt autoremove --purge -y;\
@ahmetozer
ahmetozer / nginx_HTTPS_termination.conf
Created October 5, 2020 21:48
Nginx https termination with custom domain on ip
http {
server {
listen 80;
listen [::]:80
server_name example.com;
location / {
proxy_pass https://127.0.0.1;
proxy_ssl_server_name on;
proxy_ssl_name example.local;
@ahmetozer
ahmetozer / time-update.sh
Created September 26, 2020 23:00
Update time with date and curl commands from cloudflare
#!/bin/sh
# Update time and date from cloudflare with curl and date commands.
# It is easy to use ntp is not installed servers.
# You can execute for one time update or execute with service arg to update every 600 second.
function updateDate {
date -s"@$(curl ahmetozer.org/cdn-cgi/tracert -s | grep ts= | cut -d"=" -f2 | cut -d"." -f1)"
if [ "$?" == "0" ]
then
updated="true"
@ahmetozer
ahmetozer / tcp-forward-golang.go
Created September 22, 2020 00:16
Demo of tcp connection proxy with golang.
package main
import (
"io"
"log"
"net"
"os"
)
func forward(conn net.Conn) {
@ahmetozer
ahmetozer / centos-8-kubernates-install.sh
Created September 4, 2020 21:27
centos 8 kubernates install
#!/bin/sh
set -e
if [[ $EUID -ne 0 ]]; then
echo "$0 must be run as root"
exit 1
fi
dnf install -y libselinux-utils # setenforce
setenforce 0
@ahmetozer
ahmetozer / get_ini_value.go
Created August 28, 2020 12:08
Golang String ini get value
package main
import (
"fmt"
"strings"
)
func getINI(iniText string, key string) string {
keyLoc := strings.Index(iniText, key)
@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