Skip to content

Instantly share code, notes, and snippets.

View jvdi's full-sized avatar
:fishsticks:
Learning & Work

Mohammad Javidi jvdi

:fishsticks:
Learning & Work
View GitHub Profile
@jvdi
jvdi / js_once_alert.js
Last active June 20, 2020 08:10
Java script once alert
// Use function on page Without use return
function once_alert() {
// Create variable for check alert status in browser
var alertset = localStorage.getItem('alertset') || '';
// if value not set in browser > local storage - run alert
if (alertset != 'yes') {
// write alert message in "txt"
var txt = "Write once alert";
alert(txt);
localStorage.setItem('alertset','yes');
@jvdi
jvdi / Fix Pacman - Error
Last active September 27, 2023 09:28
Resolve - Arch Pacman Error - Arch Linux Package Manager
Error :
$ sudo pacman -Syu 130 (01:59.904) < 07:38:10
:: Synchronizing package databases...
error: failed to update core (unable to lock database)
error: failed to update extra (unable to lock database)
error: failed to update community (unable to lock database)
error: failed to update multilib (unable to lock database)
error: failed to update archlinuxfr (unable to lock database)
error: failed to synchronize all databases
@jvdi
jvdi / Clean - Arch Linux after Update.md
Last active April 3, 2024 18:25
Manage Package or Clean Arch after update
  1. Clean package cache: $ sudo pacman -Sc

2.Remove unused packages: $ sudo pacman -Rns $(pacman -Qdtq)

3.Fully remove a Package with unrequire dependencys $ sudo pacman -Rns PAK_NAME

  1. get list of package with description
@jvdi
jvdi / LEMP Server with Docker
Last active October 18, 2020 16:14
Simple Nginx Php MySQL Server with Docker
version: '3.7'
# Services
services:
# Nginx Service
nginx:
image: nginx:latest
ports:
- 80:80
@jvdi
jvdi / Arch Update key.sh
Last active September 27, 2023 09:27
Key invalid -> Error in Arch - While update
sudo pacman -Syy archlinux-keyring
sudo pacman-key --populate archlinux
@jvdi
jvdi / web_browser_indexdb_example.js
Last active September 27, 2023 09:29
Browser db -> Indexdb - Example
function my_func(id, nme, prc){
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("site_data");
// Create the schema
open.onupgradeneeded = function() {
var db = open.result;
@jvdi
jvdi / rahkar-default-pos-chenger.py
Last active April 28, 2023 10:08
A robot for change a combo box(Default Pos) in RahkarPOS app
import os
from dotenv import load_dotenv
from pywinauto.application import Application
load_dotenv()
flag = True
while(True):
if flag:
try:
@jvdi
jvdi / FlaskApp_Dockerfile.Dockerfile
Last active September 27, 2023 09:26
Dockerfile for Deploy FlaskApp
FROM tiangolo/uwsgi-nginx-flask
COPY ./requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
COPY ./app /app
@jvdi
jvdi / dockerizeWireguardOverWebsocket.md
Last active June 25, 2024 06:34
Set Up a dockerize Wireguard VPN Server over WebSocket Tunneling

This tutorial good for Linux or Unix system at the end need to run bash script for connect
(Also it's have some technic for use in windows - Explained at client install section.)

VPS => virtual private server as wiregurd vpn server

Requirements

  • Assuming the firewall is off (Not Secure - it's just for test so in production: config firewall)
  • VPS have docker and docker-compose (for install instrucrion : docker site full explained)
  • In VPS enable net.ipv4.ip_forward=1 at /etc/sysctl.conf (or /etc/sysctl.d/99-sysctl.conf) and reboot your system
  • Have access to root user in VPS
@jvdi
jvdi / secure-boot_arch-linux.md
Last active April 1, 2024 19:24
Inatall Arch Linux with secure boot + encrypt (luks2 cryptlvm) partition + unlock lvm encrypt with TPM2 + Dualboot with windows

Arch Linux Install - Introduction

This guide will tell you how to install fully encrypted Arch base system with SecureBoot enabled . This specific guide uses Unified Boot Image for booting and therefore there is no need for software like GRUB.

Check this list before starting!

  • Your computer supports SecureBoot/UEFI
  • Your computer allows for enrollment of your own secureboot keys
  • Your computer does not have manufacturer's backdoors
  • You DO NOT need dualboot with windows You can choose whether you want Microsoft CA when enrolling keys