Skip to content

Instantly share code, notes, and snippets.

View Ardakilic's full-sized avatar

Arda Kılıçdağı Ardakilic

View GitHub Profile
@eser
eser / Markdown Extended.sublime-settings
Last active January 11, 2016 13:30
My Sublime Text 3 user configuration
{
"extensions":
[
"md"
],
"color_scheme": "Packages/Theme - Afterglow/Afterglow-markdown.tmTheme",
"draw_centered": true,
"draw_indent_guides": false,
"trim_trailing_white_space_on_save": false,
"word_wrap": true,
@vluzrmos
vluzrmos / HasRandomStatementTrait.php
Last active May 12, 2016 21:06
Laravel Eloquent Agnostic Random Statement
<?php
trait HasRandomStatementTrait
{
/**
* Random Statements by driver name.
* @var array
*/
protected $randomStatements = [
'mysql' => 'RAND()',
@atma
atma / ufw_rules.sh
Last active February 25, 2018 20:20
Basic rules for securing ubuntu VPS with ufw
# default rule
sudo ufw default deny
# allow ssh
sudo ufw allow 22/tcp
# enable firewall
sudo ufw enable
# allow https?
@eser
eser / .bash_profile
Last active November 19, 2018 20:41
.bash_profile
# colors
CHAR_ARROW="\xEE\x82\xB0" # ""
COLOR_RESET="\033[m"
COLOR_WHITE_ON_BLACK="\033[38;5;15m\033[48;5;0m"
COLOR_BLACK_ON_TRANSPARENT="\033[38;5;0m\033[49m"
COLOR_BLACK_ON_GRAY="\033[38;5;0m\033[48;5;237m"
COLOR_WHITE_ON_GRAY="\033[38;5;15m\033[48;5;237m"
COLOR_GRAY_ON_TRANSPARENT="\033[38;5;237m\033[49m"
@fearphage
fearphage / .gitconfig
Last active November 26, 2018 15:13
When you need to save the code before you save yourself, git fire.
[alias]
fire = !"f() { \
local current_branch=$(basename \"$(git symbolic-ref HEAD)\"); \
local new_branch=fire-${current_branch}-$(git config user.email)-$(date +%s) \
local message; \
if [ -z \"$1\" ]; then \
message=\"fire commit from $current_branch\"; \
else \
message=\"$*\"; \
fi; \

Backing up a GPG private key to a QR code

Use at your own risk! As with any backup method, test out your backup by restoring from it before you trust it.

  1. Install qrcode to generate the QR code:

     pip install qrcode
    
  2. Export the key, piping the output to qr, and save this to a png file:

@hidonet
hidonet / magento.stpl
Last active September 23, 2019 12:22
vestacp magento nginx template
# Template Updated At 2019-04-17
upstream php_backend_%domain_idn%_%web_ssl_port% {
server %backend_lsnr%;
#server %backend_lsnr% backup;
}
server {
listen %ip%:%web_ssl_port%;
server_name %domain_idn% %alias_idn%;
@canerbasaran
canerbasaran / js-rastgele-tc-no.html
Last active November 19, 2022 09:00
Rastgele TC Kimlik No Üreticisi (javascript)
<!--
Rastgele TC Kimlik No Üreticisi
Random Turkish Identification Number Generator
https: //github.com/CanerBasaran
-->
<html><p id="tc"></p>
<script type="text/javascript">
var tcno = "" + Math.floor(900000001 * Math.random() + 1e8),
list = tcno.split("").map(function(t) {
return parseInt(t, 10)
@pixeline
pixeline / php_upgrade_to_71.sh
Last active March 16, 2023 16:49
Update Mac Os X's php version to php 7.1 using homebrew. Includes curl and mcrypt
# 1. Install brew --> http://brew.sh/
# 2. run the following commands in your Terminal
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install --with-openssl curl
brew install --with-homebrew-curl --with-apache php71
brew install php71-mcrypt php71-imagick
# 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot.
brew info php71
@ohhdemgirls
ohhdemgirls / vidble.sh
Created January 20, 2014 02:49
Simple Vidble.com Album Downloader
#!/bin/bash
id="$1"
host="http://vidble.com/album/"
mkdir "$id"
wget -nv -O - "$host$id" |grep -e "<img src='" |grep -Eo '/[^" ]+(jpg|jpeg|JPG|GIF|gif|PNG|png)' |sed -e 's/_med//' -e 's@^@http://vidble.com@' > $id/links.txt
sed -i '/logo/d' $id/links.txt
wget -i $id/links.txt -P $id