This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rateLimit := time.Second / 100 // 100 messages per second | |
throttle := time.NewTicker(rateLimit) | |
for msg := range msgs { | |
<-throttle.C // Wait for the next tick | |
go handle(msg) // Process the message | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"io/ioutil" | |
"log" | |
"time" | |
"github.com/chromedp/chromedp" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ulimit | |
update os | |
install wget , zip , unzip , tcpdump | |
os limit | |
allow soduer | |
allow no password | |
swap 16 G |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo systemctl enable mongodb | |
show dbs | |
use admin | |
db.dropUser("yyyy") | |
db.createUser({user:"zzzz", pwd:"xxxx", roles:[{role:"root", db:"admin"}]}) | |
mongo -u admin -p admin123 --authenticationDatabase admin | |
enabled within the security section of your mongod.conf file (like below). | |
security: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
/** | |
* Respond with hello worker text | |
* @param {Request} request | |
*/ | |
async function handleRequest(request) { | |
if (request.method !== 'POST') { | |
return new Response('Method Not Allowed', { status: 405 }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem -Path D:\wamp64\www\product_golang\telirco\product\sms_esb\bin\linux_service\worker_db_queue_bulk\* -Recurse | Where-Object {$_ -match "peertopeer"} | Ren -NewName {$_ -replace "peertopeer","bulk"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "_ZNSt12_Bind_simpleIFPFvSsSsEPcS2_EE9_M_invokeIJLm0ELm1EEEEvSt12_Index_tupleIJXspT_EEE+0xa0" | c++filt | |
nm -D telircoampq.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in $(seq 1 100); do printf "\r%s%%" "$i"; sleep 0.1; done | |
for i in {1..100}; do | |
percent=$(($i)) | |
printf "\r%s%%" "${percent}" | |
sleep 0.1 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"time" | |
"golang.org/x/time/rate" | |
) |