Skip to content

Instantly share code, notes, and snippets.

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

Fatih Sarhan f9n

💭
I may be slow to respond.
View GitHub Profile
@f9n
f9n / regex.txt
Last active February 18, 2017 17:33
Regex Cheat Sheet
# http://ryanstutorials.net/regular-expressions-tutorial/
dot (.) Match any character.
[ ] Match a range of characters contained within the square brackets.
[^ ] Match a character which is not one of those contained within the square brackets.
* Match zero or more of the preceeding item.
+ Match one or more of the preceeding item.
? Match zero or one of the preceeding item.
{n} Match exactly n of the preceeding item.
{n,m} Match between n and m of the preceeding item.
{n,} Match n or more of the preceeding item.
@f9n
f9n / Postgresql-instructions
Last active March 13, 2017 20:16
Postgresql instructions
# Installing PostgreSql
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| (bash)$ dnf install postgresql postgresql-server postgresql-contrib |
| (bash)$ # Start PostgreSql database server |
| (bash)$ service postgresql initdb |
| (bash)$ service postgresql start |
| (bash)$ # Autostart PostgreSql on Boot |
| (bash)$ systemctl start postgresql service |
| (bash)$ systemctl enable postgresql service |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
@f9n
f9n / Mysql-Instructions
Last active May 9, 2017 10:25
Mysql Instructions
# Installing Mysql
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| (bash)$ pacman -S mysql |
| (bash)$ mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql |
| (bash)$ sudo systemctl start mysqld |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
# Accesing Mysql
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| (bash)$ mysql -u root -p |
@f9n
f9n / Download-EntireSite
Created May 15, 2017 13:53
Read site with offline
$ wget -mkEpnp http://example.org
@f9n
f9n / Heroku-Nodejs-Meteor
Created May 18, 2017 11:56
Nodejs deploy heroku
$ heroku login
$ heroku create <appname> --stack cedar --region us --buildpack https://github.com/AdmitHub/meteor-buildpack-horse.git
$ heroku config:set MONGO_URL=mongodb://<username>:<password>@ds027308.mongolab.com:27308/<dbname>
$ heroku config:set ROOT_URL=<appname>.herokuapp.com
$ heroku git:remote -a <appname>
$ git push heroku master
#!/usr/local/bin/python3.6
import requests
import feedparser
from urllib.parse import urljoin
from lxml import html
def findfeedWithLxml(site):
raw = requests.get(site).content
result = []
possibleFeeds = []
@f9n
f9n / ss-[A-Z]
Created September 8, 2017 20:52
ShellScript, [A-Z] match lowercase letters
#!/bin/bash
# https://unix.stackexchange.com/questions/92445/bash-script-check-if-a-variable-is-in-a-z
# Exampl1
echo -e "Enter a character: \c"
read value
# LC_ALL=C or LANG=C
case $value in
[a-z] )
echo "$value => a to z" ;;
@f9n
f9n / spacemacs-change-font-size.txt
Created September 16, 2017 09:34
Change font size
$ vim ~/.spacemacs
...
...
;; Default font, or prioritized list of fonts. `powerline-scale' allows to
;; quickly tweak the mode-line size to make separators look not too crappy.
dotspacemacs-default-font '("Source Code Pro"
:size 20 ;; In here
:weight normal
:width normal
:powerline-scale 1.1)
@f9n
f9n / AnsibleSsh.md
Last active October 22, 2017 13:57
Ansible Ssh Config

For Slaves

You must install openssh-server to slave machines.

$ sudo apt-get install openssh-server

Then, restart sshd service

$ sudo systemctl restart sshd

@f9n
f9n / pacaur-bug
Created June 19, 2017 11:03
pacaur - editor variable unset
$ pacaur -Syu
:: editor variable unset
$ export EDITOR='vim'
$ export VISUAL='vim'
$ pacaur -Syu
:: Synchronizing package databases...
antergos is up to date
core is up to date
extra 1667.3 KiB 838K/s 00:02 [########################################] 100%
community 3.9 MiB 634K/s 00:06 [########################################] 100%