Skip to content

Instantly share code, notes, and snippets.

View DanAmt's full-sized avatar
🎯
Focusing

Dan Am DanAmt

🎯
Focusing
View GitHub Profile
@DanAmt
DanAmt / gist:be549a9cc11aacbb1e207778783ae9f1
Created October 8, 2021 16:17
python function return tuple
def top_tourist_locations_italy():
first = "Rome"
second = "Venice"
third = "Florence"
return first, second, third
most_popular = top_tourist_locations_italy()
for i in (range(3)):
print(most_popular[i])
@DanAmt
DanAmt / test-socket.py
Last active February 8, 2022 15:35
Here we can test a socket without netstat telnet and so on
#!/bin/python
#For socket checking in case no tools around except python
import socket
import sys
if len(sys.argv) != 3:
print("Usage: " + sys.argv[0] + " <IP or Name> <Port>")
sys.exit(2)
s = socket.socket()
@DanAmt
DanAmt / gist:a3b5444a229be690d96c9a47fd8c2b48
Created March 8, 2022 08:52
Kill all threads on a mysql db
Select concat('KILL ',id,';') from information_schema.processlist where db='ipworkflow';