Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
/* | |
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(); | |
} |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
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; |
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). | |
# |
#!/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 |