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
-- scriptdb.logs definition | |
CREATE TABLE `logs` ( | |
`id` int NOT NULL AUTO_INCREMENT, | |
`traceId` text, | |
`eventId` text, | |
`eventName` text, | |
`actionType` text, | |
`userId` text, | |
`msisdn` text, |
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
#!/bin/bash | |
root_dir="/c/testLg" | |
trap 'echo "Error processing file: $1"' ERR | |
find "$root_dir" -type f \( -name "*.log" -o -name "*.gz" \) | while read file; do | |
if [[ $file =~ \.gz$ ]]; then | |
zgrep -Eaic "connreset|error|:500" "$file" 2>null | while read count; do | |
if [[ $count -gt 0 ]]; then |
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
# require: pip3 install mysql-connector-python | |
import mysql.connector | |
class MySQLManager: | |
def __init__(self, host, user, passwd, database, port=3306): | |
self.mydb = mysql.connector.connect( | |
host=host, | |
user=user, | |
passwd=passwd, | |
database=database, |
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
import socket | |
import sys | |
def find_available_ports(start_port, end_port): | |
available_ports = [] | |
for port in range(start_port, end_port+1): | |
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: | |
# Set a timeout for trying to bind to a port | |
s.settimeout(1) | |
try: |
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
#!/bin/bash | |
if [[ $# -eq 0 ]] ; then | |
echo 'Usage: ./$0 <port> <port> <port> ...' | |
exit 0 | |
fi | |
cnt=0 | |
for port in $@; do | |
while :; do |
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
[{"value":"01001 – Growing and manufacturing of tea","label":"01001 – Growing and manufacturing of tea"},{"value":"01002 – Growing and manufacturing of coffee","label":"01002 – Growing and manufacturing of coffee"},{"value":"01003 – Growing and manufacturing of rubber","label":"01003 – Growing and manufacturing of rubber"},{"value":"01004 – Market gardening and horticulture specialties","label":"01004 – Market gardening and horticulture specialties"},{"value":"01005 – Raising of silk worms and production of silk","label":"01005 – Raising of silk worms and production of silk"},{"value":"01006 – Raising of bees and production of honey","label":"01006 – Raising of bees and production of honey"},{"value":"01007 – Raising of poultry and production of eggs","label":"01007 – Raising of poultry and production of eggs"},{"value":"01008 – Rearing of sheep and production of wool","label":"01008 – Rearing of sheep and production of wool"},{"value":"01009 – Rearing of animals and production of animal products","label":"01 |
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
async function removeFriends(unfriendTotal, removeFriendName) { | |
const delay = (delayInms) => { | |
return new Promise(resolve => setTimeout(resolve, delayInms)); | |
} | |
async function un() { | |
try { | |
let nodes = [] | |
// $('.x6s0dn4.x78zum5.x1q0g3np div[aria-label="More"]').click() | |
if ($('div.xb57i2i .x4k7w5x.x1h91t0o.x1beo9mf.xaigb6o.x12ejxvf.x3igimt.xarpa2k.xedcshv.x1lytzrv.x1t2pt76.x7ja8zs.x1n2onr6.x1qrby5j.x1jfb8zj')) { |
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
class Node { | |
constructor(char) { | |
this.char = char; | |
this.right = this.left = this.middle = this.eow = null; | |
} | |
} | |
class TST { | |
constructor() { | |
this.root = null; |
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
/* 1 */ | |
{ | |
"code" : "AF", | |
"name" : "Afghanistan", | |
"status" : false, | |
"borders" : null, | |
"callingCodes" : [ | |
"93" | |
], | |
"capital" : "Kabul", |
NewerOlder