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 / aur-package-downloading.txt
Last active December 14, 2018 19:28
ArchLinux-Aur
### Aur package Downloading
## First Way
$ git clone http://aur.archlinux.org/package.git
$ cd package
$ makepkg -Sri
## Second Way
$ git clone http://aur.archlinux.org/package.git
$ makepkg -s
$ sudo pacman -U package.tar.[xz|gz]
@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-Arch-Error
Last active August 10, 2018 13:53
Postgresql error
(root)# systemctl start postgresql
Job for postgresql.service failed because the control process exited with error code.
See "systemctl status postgresql.service" and "journalctl -xe" for details
(root)# systemctl status postgresql
● postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2017-03-06 07:52:38 UTC; 12s ago
Process: 10052 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data (code=exited, status=1/FAILURE)
CPU: 6ms
@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 / 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%
@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" ;;