Skip to content

Instantly share code, notes, and snippets.

View RafikFarhad's full-sized avatar
😎

Rafik Farhad RafikFarhad

😎
View GitHub Profile
/*
Full featured fraction class
*/
template <class T = long long> struct Fraction {
T a, b;
Fraction (T a = T(0), T b = T(1)): a(a), b(b) {
this->Normalize();
}
@RafikFarhad
RafikFarhad / README.md
Created September 29, 2017 10:04 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@RafikFarhad
RafikFarhad / nginx.conf
Created November 29, 2018 07:48 — forked from ashleydw/nginx.conf
Laravel nginx conf file
server {
listen 80 default_server;
server_name example.com www.example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public;
index index.php index.html;
server {
listen 51;
root /usr/share/adminer;
# Logging
error_log /var/log/nginx/adminer.access_log;
access_log /var/log/nginx/adminer.error_log;
@RafikFarhad
RafikFarhad / default.conf
Last active February 14, 2019 20:31
A default NGINX Configuration file with cache support.
server {
server_name _;
listen 80;
#charset koi8-r;
access_log /var/log/nginx/host.access.log main;
root /var/www/laravel/public;
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#
@RafikFarhad
RafikFarhad / kbd_light.sh
Last active February 26, 2019 21:47
# Asus Vivobook Keyboard Light
#!/bin/bash
brightness=$(cat "/sys/class/leds/asus::kbd_backlight/brightness")
# a=$((brightness-1))
if [ "$brightness" -gt 2 ]
then
a=0
echo $a >> /sys/class/leds/asus\:\:kbd_backlight/brightness
elif [ "$brightness" -gt 0 ]
then
a=$((brightness+1))
swipe:
3:
left:
command: 'xdotool key alt+Tab'
right:
command: 'xdotool key alt+shift+Tab'
up:
command: 'xdotool key super'
down:
command: 'xdotool key super'
#!/bin/bash
# Author: Rafik Farhad
# 26-06-2019
# cat file.sh | SSHPASS=****** sshpass -e ssh root@host
echo -e "\e[32mLogged in to server\e[39m"
echo -e ""
echo -e "\e[32m--------------------------------------\e[39m"
echo -e "\e[32mBackend\e[39m"
#!/bin/bash
mode=$1
if [ "$mode" = "stop" ]
then
echo -e "Stopping Services..."
sudo service nginx stop
sudo service mysql stop
sudo service php7.3-fpm stop