Skip to content

Instantly share code, notes, and snippets.

View Hebrahimzadeh's full-sized avatar
🎯
Focusing

Hossein Ebrahimzadeh Hebrahimzadeh

🎯
Focusing
View GitHub Profile
@Hebrahimzadeh
Hebrahimzadeh / chroot.sh
Created December 10, 2023 15:20 — forked from uglide/chroot.sh
Chroot to Installed system on LVM
#!/bin/bash
fdisk -lu
pvscan
vgscan
vgchange -a y
lvscan
mount /dev/ubuntu-vg/root /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
@Hebrahimzadeh
Hebrahimzadeh / gist:a5db9094e2d0afeddd42cc6adfcc347f
Created September 19, 2023 14:46
TinyMCE Configs in Voyager
/*--------------------
|
| TinyMCE default config
|
--------------------*/
var getConfig = function(options) {
var baseTinymceConfig = {
menubar: false,
@Hebrahimzadeh
Hebrahimzadeh / gitlab.rb
Created August 28, 2022 11:02 — forked from Erutan409/gitlab.rb
Gitlab Nginx Reverse Proxy Configuration (with Let's Encrypt SSL)
# These are fragments of the configuration that will need to be updated
# ---
## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
external_url 'https://gitlab.your-fqdn.com'
#external_url 'http://gitlab.internal.lan'
@Hebrahimzadeh
Hebrahimzadeh / nginx.conf
Created June 19, 2022 15:00 — forked from CSRaghunandan/nginx.conf
Nginx configuration for serving mp4 videos
#user nobody;
worker_processes 4;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@Hebrahimzadeh
Hebrahimzadeh / jinja_variables_types.yml
Created February 28, 2022 05:59 — forked from spiette/jinja_variables_types.yml
Test the variables types in jinja2 templates, used here with ansible
---
- hosts: all
gather_facts: no
vars:
string: "string"
list:
- item1
- item2
dict:
key1: value1
@Hebrahimzadeh
Hebrahimzadeh / pr.md
Created February 17, 2022 15:22 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@Hebrahimzadeh
Hebrahimzadeh / check_and_extract.groovy
Created February 9, 2022 09:04 — forked from kdabir/check_and_extract.groovy
finding regex matches in text in groovy
def m = "1234 abc" =~ /^(\d+)/
def n = "abc 1234" =~ /^(\d+)/
println (m.find()?m.group():"not matched")
println (n.find()?n.group():"not matched")
@Hebrahimzadeh
Hebrahimzadeh / ffmpeg wav to mp3 and versa
Last active December 19, 2021 10:37 — forked from dominicthomas/ffmpeg wav -> mp3
Convert a wav to a 320k mp3 using ffmpeg and versa
# wav to mp3
ffmpeg -i inputfile.wav -ab 320k outputfile.mp3
# mp3 to wav batch
for i in *.mp3; do ffmpeg -i "$i" -acodec pcm_u8 -ar 22050 "${i%.*}.wav"; done
@Hebrahimzadeh
Hebrahimzadeh / multiple_ssh_setting.md
Created December 8, 2021 09:49 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@Hebrahimzadeh
Hebrahimzadeh / Create_Laravel_Pipeline.txt
Last active December 7, 2021 17:13 — forked from omaryoussef/Create_Laravel_Pipeline.txt
Creates a Filebeat pipeline to ingest Laravel Monolog/log lines.
PUT _ingest/pipeline/laravel
{
"description": "Parses Laravel log files.",
"processors": [
{
"rename": {
"field": "message",
"target_field": "event.original"
}
},