Skip to content

Instantly share code, notes, and snippets.

View unique1984's full-sized avatar
💭
I may be slow to respond.

Yasin KARABULAK unique1984

💭
I may be slow to respond.
View GitHub Profile
@unique1984
unique1984 / ovpn_autostart
Last active March 15, 2020 13:59
ovpn_autostart
#!/bin/sh
OVPNCONF="/root/ovpn/client.ovpn"
RUNNING=$(ps aux | grep -o "openvpn \-\-config" | wc -l)
case "$1" in
start)
if [ $RUNNING -eq 0 ]; then
echo -n > /var/log/ovpn_autostart.log
nohup openvpn --config "$OVPNCONF" > /var/log/ovpn_autostart.log 2>&1 &
else
@unique1984
unique1984 / evm
Last active September 2, 2018 03:12
easy virtualbox management bash script
#!/bin/bash
#---------------------------------------------------------------------#
# evm #
# #
# easy virtualbox management bash script #
# #
# Script : evm #
# Version : 1.0.1 #
# Author : Yasin KARABULAK <yasinkarabulak@gmail.com> #
# Date : 2017-08-30 #
@unique1984
unique1984 / arraySearch.class.php
Last active February 21, 2019 09:34
Recursive Array Search class for PHP
<?php
/*****************************************
*
* array search Copyright (C) 2009 - 2017 Yasin KARABULAK (YsnSoftware) All Rights Reserved
* email: info@yasinkarabulak.com
*
*******************************************/
class arraySearch
{
@unique1984
unique1984 / curl_login.php
Created September 4, 2017 18:11
CURL Login Script PHP
<?php
$username="admin";
$password="1234";
$protocol="https";
//~ our log in data
$post = array(
'username' => urlencode($username),
'password' => urlencode($password)
);
$post_string = http_build_query($post);
@unique1984
unique1984 / top.php
Last active November 8, 2017 22:41
Linux System Resources PHP implementation
#!/usr/bin/php
<?php
$sleep_militime=150000;
class top_info{
private static function top_command(){
exec("/usr/bin/top -b -n1",$out);
return $out;
}
@unique1984
unique1984 / screenrec.sh
Last active August 24, 2018 18:03
Screen Recorder Shell Script with ffmpeg
#!/bin/bash
#---------------------------------------------------------------------
# screenrec.sh
#
# ffmpeg shellscript screen recorder
#
# Script: screenrec.sh
# Version: 1.1.0
# Author: Yasin KARABULAK <yasinkarabulak@gmail.com>
#
@unique1984
unique1984 / ssl_look.php
Last active June 30, 2018 09:14
ISP Config 3.1 için letsencrypt ssl güncelleme sorununa getirilen çözüm
<?php
//~ exec("ls -m /etc/letsencrypt/live",$out);
///explode(",",$out);
//~ print_r($out);
//~ $out=implode("",$out);
//~ $out=explode(",",$out);
//~ print_r($out);
function get_web_sites(){
exec("find /var/www -maxdepth 1 -type l",$out);
@unique1984
unique1984 / pull_all.sh
Created September 5, 2017 04:13
Pull all Git repositories nested one directory recursively
#!/bin/bash
if [ -z $1 ]; then
find -type d -name .git -exec echo {} \; -exec git --git-dir={} --work-tree=$PWD/{}/.. fetch --all \; -exec git --git-dir={} --work-tree=$PWD/{}/.. pull origin master \;
else
find $1 -type d -name .git -exec echo {} \; -exec git --git-dir={} --work-tree=$PWD/{}/.. fetch --all \; -exec git --git-dir={} --work-tree=$PWD/{}/.. pull origin master \;
fi
@unique1984
unique1984 / ip.sh
Last active August 17, 2019 12:47
What is my IP tool and much more
#!/bin/bash
# chmod +x ip.sh
# ./ip.sh will give your ip and much more
PAGE=$(wget -qO- https://ysnteknoloji.com/geoip/location.php)
tarih=$(echo $PAGE | grep -oP "Tarih\s*:\K([0-9\.\s:]*)")
ip=$(echo $PAGE | grep -oP "IP\s*:\K([0-9\.]*)")
echo -e "Tarih\t\t" $(echo $PAGE | grep -oP "Tarih\s*:\K([0-9\.\s:]*)")
echo -e "IP\t\t" $(echo $PAGE | grep -oP "IP\s*:\K([0-9\.]*)")
echo -e "Enlem\t\t" $(echo $PAGE | grep -oP "Enlem\s*:\K([0-9\.]*)")
echo -e "Boylam\t\t" $(echo $PAGE | grep -oP "Boylam\s*:\K([0-9\.]*)")
@unique1984
unique1984 / add_ovpn.sh
Last active September 7, 2018 09:06
OpenVpn Server Create Config File
#!/usr/bin/env bash
if [ -z $1 ]; then
echo "sertifika ve ovpn oluşturulacak ismi yazınız !"
else
if [ ! -d /root/ovpn ]; then
mkdir /root/ovpn
fi
cd /etc/openvpn/easy-rsa/