Skip to content

Instantly share code, notes, and snippets.

View Kambaa's full-sized avatar

KambaAbi Kambaa

  • KambaAbi
  • Istanbul, Turkey
View GitHub Profile
@Kambaa
Kambaa / gogs
Created March 25, 2016 14:10 — forked from infostreams/gogs
Debian startup (init.d) script for gogs.io
#! /bin/sh
### BEGIN INIT INFO
# Provides: gogs
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Git repository manager Gogs
# Description: Starts and stops the self-hosted git repository manager Gogs
### END INIT INFO
@Kambaa
Kambaa / Trickshots 1
Created June 15, 2016 13:38 — forked from mojaray2k/Trickshots 1
Use jQuery to send a HEAD request with AJAX and get the size of a file without downloading it. This snippet places the size of the file in braces next to its name. The script issues a HEAD request, which only returns the headers and not the actual content of the file, which means that these requests are fast and lightweight.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Display files sizes next to download links</title>
</head>
<body>
<a href="001.html" class="fetchSize">First Trickshot</a>
<a href="034.html" class="fetchSize">This Trickshot</a>
<a href="ball.png" class="fetchSize">Ball.png</a>
@Kambaa
Kambaa / gist:054555bd52ccdfebd56f0a4c0edede96
Created June 18, 2016 22:31 — forked from troelskn/gist:1287893
Luhn's algorithm in php
<?php
function is_valid_luhn($number) {
settype($number, 'string');
$sumTable = array(
array(0,1,2,3,4,5,6,7,8,9),
array(0,2,4,6,8,1,3,5,7,9));
$sum = 0;
$flip = 0;
for ($i = strlen($number) - 1; $i >= 0; $i--) {
$sum += $sumTable[$flip++ & 0x1][$number[$i]];
@Kambaa
Kambaa / sehirler.html
Created June 20, 2016 14:14 — forked from aladagemre/sehirler.html
Türkiye Şehir Listesi HTML Select Option
<select name="Sehir">
<option value="0">------</option>
<option value="1">Adana</option>
<option value="2">Adıyaman</option>
<option value="3">Afyonkarahisar</option>
<option value="4">Ağrı</option>
<option value="5">Amasya</option>
<option value="6">Ankara</option>
<option value="7">Antalya</option>
<option value="8">Artvin</option>
@Kambaa
Kambaa / install-docker-mint.sh
Created July 14, 2017 11:49 — forked from mmcc/install-docker-mint.sh
Install Docker on Linux Mint 17
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sh -c 'echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list'
# Install docker
sudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-get install linux-image-extra-$(uname -r)
sudo apt-get install docker-engine
sudo service docker start
@Kambaa
Kambaa / appcache.php
Created December 18, 2018 13:36 — forked from jrobinsonc/appcache.php
AppCache generator #php #appcache
<?php
function get_dir($dir)
{
$files = array();
$exclude = array('.', '..', 'appcache.php', '.git', '.gitignore', 'nbproject', 'TODO', 'README.md', 'cache.manifest');
foreach (scandir($dir) as $item)
{
if (in_array($item, $exclude)) continue;
@Kambaa
Kambaa / ssl-transmission-nginx.conf
Last active January 25, 2020 16:46 — forked from michaelkeevildown/ssl-transmission-nginx.conf
SSL Transmission Nginx Config
server {
listen 80 default_server;
server_name domain.com;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 default_server;
server_name domain.com;
@Kambaa
Kambaa / IntelIJTrialReset.bat
Created March 11, 2019 14:24
How to Reset InteIIiJ IDEA Evaluation Key in Windows
cd "C:%HOMEPATH%\.IntelliJIdea*\config"
rmdir "eval" /s /q
del "options\other.xml"
reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\idea" /f
:: This will work for idea 2018.3 and later
::
:: It is Highly Advised to Purchase the JetBrain Softwares
:: This is only for the case You just want to Extend the
:: Trial Period and Evaluate the IDE for some more Time
@Kambaa
Kambaa / jail.local
Created May 7, 2022 22:26 — forked from Nihisil/jail.local
Send notifications to the Slack from fail2ban
...
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$
slack[name=%(__name__)s]
action = %(action_with_slack_notification)s
...
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,