Skip to content

Instantly share code, notes, and snippets.

View vheidari's full-sized avatar
🏠
Working from home

Vahid Heidari vheidari

🏠
Working from home
View GitHub Profile
@vheidari
vheidari / rename.py
Created September 7, 2019 21:54
rename and numbering files with python.
import os
import shutil
fileNames = ["one", "two", "three"]
i = 1
for fileName in fileNames:
srcName = "./" + fileName
destName = "./dest/" + str(i) + "." + fileName

Keybase proof

I hereby claim:

  • I am vheidari on github.
  • I am vheidari (https://keybase.io/vheidari) on keybase.
  • I have a public key ASD53i-qUAbKhv-KgnUiP67iCyvddJsvVEuz8SL87tzLvgo

To claim this, I am signing this object:

@vheidari
vheidari / stop-auto-update-resolve.conf.txt
Last active April 1, 2020 23:36
[ubuntu] : stop auto update name server in /etc/resolve.conf
[Command] :
1. sudo apt-get install dnsmasq
2. sudo apt-get install network-manenger
----------------------------------------------------------
[Solution[one]] :
1. nano /etc/dnsmasq.conf
2. add dns server ip in dnsmasq.conf :
-ex :server=ipaddress
server=8.8.8.8
server=8.1.8.1
@vheidari
vheidari / docker command
Last active April 3, 2020 23:35
Quick docker command with example
download an image from docker hub :
docker pull hello-world
-------------------------------------
running or creating a process or container from an image:
docker run nginx
-------------------------------------
show list of process:
docker ps
show list of latests process with -a [archive] switch
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
@vheidari
vheidari / msys2-curl-ssl-issus.txt
Last active May 4, 2021 10:34
MSYS2 - Curl ssl certification problems
#Add pem.sh script part in ~/bash/pem.sh
#----------------------------------------------------------------------------
#Start pem.sh script
#----------------------------------------------------------------------------
#cacert.pem name
CERT=cacert.pem
echo "Start fix curl ssl Certificat issus !"
@vheidari
vheidari / git-tips
Created May 28, 2021 12:05
📌 Git Quick Tips :
GIT INIT :
= Add new repositry in local machin
- `git init`
=======================================================
GIT ADD :
= Add files to git track them
- `git add .`
- `git add -A`
@vheidari
vheidari / webptopng.bat
Last active March 29, 2022 09:18
Webp format to Png with Windows batch script and dwebp.exe
@echo off
set list=*.webp
(for %%a in (%list%) do (
dwebp.exe %%a -o %%a.png
))
echo "All .webp file converted to .png"
@vheidari
vheidari / vim-cheat-sheet.md
Last active July 10, 2022 14:47
Useful Vim Cheat Sheet
  1. Change to editor mode : [ i ]
  2. Chagne to viewer mode : [ esc ]
  3. Select multi line of code : [ v ]
  4. Cut multi line of code : [ x ]
  5. Past cuted or copied lines : viewer mode -> [ p ]
  6. Search and replace a word inside file : viewer mode -> [ :s/word/replace ]
  7. Search and replace a all word inside file : viewer mode -> [ :%s/word/replace ]
  8. Delete a word in viewer mode : viewer mode -> [ d ] -> [ e ]
  9. Delete multi word in viewer mode : viewer mode -> [ d ] -> [ number] -> [ e ]
  10. Delete a char in viewer mode : viewer mode -> [ d ] -> [ right arrow ]
@vheidari
vheidari / GitHub-ssh-access-token.md
Last active July 12, 2022 10:24
Github - Creating a personal access token and add token authentication to github

Github Added token authentication requirements for Git operations in july 2021

Following instruction help us to generating ssh token and add it to github then working with ssh rather than https.

For more information plase read this blog post : MoreInfo


Purpose :