Skip to content

Instantly share code, notes, and snippets.

View katoozi's full-sized avatar
🏡
Working from home

mohammad katoozi katoozi

🏡
Working from home
  • Tehran, Iran
View GitHub Profile
@katoozi
katoozi / .Xdefault
Created May 27, 2019 07:37
urxvt configuration
!! Appearance
urxvt.termName: rxvt-unicode
urxvt.scrollBar: false
urxvt.background: black
urxvt.foreground: gray
!! Font prefferenes
urxvt.font: xft:consolas:pixelsize=18,xft:FontAwesome:pixelsize=18
urxvt.boldFont: xft:consolas:pixelsize=18:weight=bold,xft:FontAwesome:pixelsize=18:weight=bold
URxvt*italicFont: xft:consolas:pixelsize=18:weight=bold,xft:FontAwesome:pixelsize=18:weight=bold
@katoozi
katoozi / .gitlab-ci.yml
Created May 27, 2019 07:42
simple gitlab ci for django application
before_script:
- python -V
- make init
- cp test_project/settings.py.sample test_project/local_settings.py
- sed -i -e "s/SECRET_KEY = '.*'/SECRET_KEY = '_'/" test_project/local_settings.py
- make setup
variables:
CODECOV_TOKEN: '0707a6a4-2ac4-4440-a35d-e43c77fd57d2'
PIPENV_VENV_IN_PROJECT: 1
@katoozi
katoozi / auto_lock.sh
Last active February 3, 2024 01:26
my i3 config files
#!/bin/sh -e
# Take a screenshot
#scrot /tmp/screen_locked.png
# Pixellate it 10x
#mogrify -scale 10% -scale 1000% /tmp/screen_locked.png
# Lock screen displaying this image.
i3lock -i /usr/share/backgrounds/warty-final-ubuntu.png
@katoozi
katoozi / .EnvironmentFile.env
Last active June 14, 2020 19:25
Django Server Config
NAME=project
DJANGODIR=/home/user/project
SOCKFILE=/home/user/project/run/gunicorn.sock
USER=user
GROUP=www-data
NUM_WORKERS=3
DJANGO_SETTINGS_MODULE=project.local_settings
DJANGO_WSGI_MODULE=project.wsgi
LOG_FILE=/home/user/project/logs/gunicorn.log
LOG_LEVEL=debug
{
"Paste Language Code Loader": {
"prefix": "language_settings_loader",
"body": [
"{% get_current_language as LANGUAGE_CODE %}",
""
],
"description": "Django Language Code Setting"
},
"Paste All Language Settings": {
@katoozi
katoozi / certbot.sh
Last active June 7, 2020 08:14
generate sll with let's encrypt command
sudo certbot certonly --standalone --preferred-challenges http -d [sundomain.domain.com || example.com]
@katoozi
katoozi / create-postgresql-user-and-db.sh
Last active July 30, 2019 08:30
install nginx, certbot, postgresql on ubuntu server
sudo -u postgres psql
1. create database mydb;
2. create user myuser with encrypted password 'mypass';
3. grant all privileges on database mydb to myuser;
@katoozi
katoozi / django_dump_data.sh
Last active June 14, 2020 19:21
Django Backup Command
python3 manage.py dumpdata --natural-foreign --exclude auth.permission --exclude contenttypes --exclude admin.LogEntry --exclude sessions > db.json
@katoozi
katoozi / connect.sh
Created September 5, 2019 08:56
ipsec vpn connection script. work with https://github.com/hwdsl2/setup-ipsec-vpn
#!/usr/bin/env bash
# output text colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
detect_current_connection(){
result="$(ip route | grep 'default dev ppp' | awk '{print $3}')"
}
@katoozi
katoozi / start_django.sh
Last active June 26, 2020 12:34
start django application inside a docker image
#!/bin/sh
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
start_django(){
echo -e "${GREEN}-----------Start Collecting Static Files.--------------${NC}"
python manage.py collectstatic --no-input
echo -e "\n${GREEN}-----------Done Collecting Static Files.---------------${NC}\n"