Skip to content

Instantly share code, notes, and snippets.

View parsibox's full-sized avatar

Mohsen Davari parsibox

View GitHub Profile
@parsibox
parsibox / linux.bat
Created September 25, 2024 20:10
build compress linux output fast with one click in windows
@echo off
REM Find the first Go file in the folder
for %%f in (*.go) do (
set GOFILE=%%f
goto :found
)
:found
if not defined GOFILE (
echo No Go file found in the current directory.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\NewGoFile]
"Icon"="C:\\Program Files\\Go\\bin\\go.exe"
"MUIVerb"="New Go File"
"Position"="Top"
[HKEY_CLASSES_ROOT\Directory\Background\shell\NewGoFile\command]
@="cmd /c \"echo. > \"%V\\newfile.go\" && notepad \"%V\\newfile.go\"\""
@parsibox
parsibox / CentOS-Base.repo
Created September 21, 2024 14:47
centos 7 repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
@parsibox
parsibox / MyService
Created September 9, 2024 08:03
go windows service
go build -ldflags "-s -w"
PS C:\> sc.exe create MyService <path to your service_app.exe>
PS C:\> sc.exe start MyService
PS C:\> sc.exe delete MyService
// file: main.go
package main
import (
Run vi /etc/multipath.conf and add this to the file:
defaults {
user_friendly_names yes
}
blacklist {
device {
vendor "VMware"
product "Virtual disk"
g++.exe ro.cpp
@parsibox
parsibox / decode.go
Created May 10, 2024 21:09
unpackGSM7 converts GSM 7-bit packed data to a UTF-8 string
package main
import (
"encoding/hex"
"fmt"
)
func main() {
pdu := "b11a" // Example PDU hex string
decodedBytes, err := hex.DecodeString(pdu)
Export-WindowsDriver -Online -Destination c:\drivers
composer init
{
"name": "ArrayUniqueTest/test-project",
"require-dev": {
"phpunit/phpunit": "^9.5"
}
}
composer install --dev
./vendor/bin/phpunit ArrayUniqueTest.php
//بیخال شدن از تغییرات تا الان
git reset --hard