Skip to content

Instantly share code, notes, and snippets.

View parsibox's full-sized avatar

Mohsen Davari parsibox

View GitHub Profile
//0xd10b684DB06fc09A2f6B2744DeF46c81673Fb8c2
var nextRunTimeRandom;
function getRandomTime() {
nextRunTimeRandom =Math.floor(Math.random() * 111) + 125;
return nextRunTimeRandom;
}
// Function to create the div and apply the style
function createLastRunTimeDiv() {
var div = document.createElement('div');
div.id = 'lastRunTime';
@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
sudo -i
sudo yum -y update
sudo yum -y install epel-release
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install -y fio ioping nload psmisc wget htop nano iftop telnet net-tools mlocate mtr yum-utils sysstat zip unzip traceroute tcptraceroute tcpdump bind-utils ftp.x86_64 policycoreutils-python
sudo sed -i -e 's/10/2/g' /etc/cron.d/sysstat
sudo echo "DefaultLimitNOFILE=1024000" >> /etc/systemd/system.conf
sudo echo "DefaultLimitNOFILE=1024000" >> /etc/systemd/user.conf
@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
@parsibox
parsibox / ip.php
Created January 19, 2024 09:48
server ip with api
<?php
// Make a request to ipify API
$apiUrl = 'https://api.ipify.org?format=json';
$response = file_get_contents($apiUrl);
// Check if the request was successful
if ($response !== false) {
// Decode the JSON response
$data = json_decode($response, true);
@parsibox
parsibox / check_for_hack_directadmin_shell
Last active January 5, 2024 13:57
check for shell script in directadmin vps ( hack , find , directadmin )
grep -lr --include=*.php "eval(base64_decode" /home
find /home -type f -name '*.php' | xargs grep -l "eval *(" --color
find /home -type f -name '*.php' | xargs grep -l "base64_decode *(" --color
find /home -type f -name '*.php' | xargs grep -l "gzinflate *(" --color
find /home -type f -name '*.php' | xargs grep -l "outdo" --color
find /home -type f -name '*.php' | xargs grep -l "eval*_POST" --color
find /home -type f -name '*.php' | xargs grep -l "$ptzrw" --color
find /home/*/domains/*/public_html/wp-content/uploads -type f -name '*.php'
find /home/ -type d -perm 777 -exec find {} -name "*.php" \;
@parsibox
parsibox / ubuntu
Last active December 14, 2023 07:11
sudo su
Suppress lengthy login messages:
touch .hushlogin
Get the existing package metadata up to date, and upgrade all existing packages:
apt -y update
apt -y upgrade
apt -y install mlocate