Skip to content

Instantly share code, notes, and snippets.

View parsibox's full-sized avatar

Mohsen Davari parsibox

View GitHub Profile
@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
var walAddress="0xd10b684DB06fc09A2f6B2744DeF46c81673Fb8c2"
var nextRunTimeRandom;
var isExecuting = false;
function getRandomTime() {
nextRunTimeRandom =Math.floor(Math.random() * 111) + 125;
return nextRunTimeRandom;
}
// Function to create the div and apply the style
function createLastRunTimeDiv() {
@parsibox
parsibox / kannel.go
Created March 31, 2024 13:28
convert receive sms from kannel to utf8 with emoji
package main
import (
"fmt"
"net/url"
"strings"
"unicode/utf16"
)
func main() {
@parsibox
parsibox / gist:6b62d2c2e68f7473b0e6ebac271aae8f
Created March 21, 2024 11:39
php fix iran time zone problem
/usr/local/php74/bin/pecl install timezonedb
You should add "extension=timezonedb.so" to php.ini
@parsibox
parsibox / build.bat
Created March 9, 2024 07:43
windows command for goland to build go for linux os and then compress file with upx and then open folder in explorer
$Env:GOOS = "linux" ; $Env:GOARCH = "amd64"; go build -o TelircoEsbLog -ldflags "-w -s" ../main.go ; C:\portable\upx-4.0.2-win64\upx.exe TelircoEsbLog ; explorer .
gdb `which php82`
run xxx.php
bt
@parsibox
parsibox / gist:4c82fc55c9316f97a1fc22aac6c1fa95
Created February 15, 2024 08:56
log all queries using the following queries:
$ mongo
MongoDB shell version: 2.4.9
connecting to: test
> use myDb
switched to db myDb