View a.py
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
@router.get("/request-received",tags=["request"]) | |
def get_request_received(user_id:str): | |
utils_db_order_ads.db.connect(reuse_if_open=True) | |
# step1: get marketer id | |
L = utils_db_order_ads.Marketer.select().where(utils_db_order_ads.Marketer.user_meey_id == user_id) | |
if len(L)==0: | |
return {'err':'not found marketer_id'} |
View list_request.py
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
@router.get("/request",tags=["request"]) | |
def get_request(user_id:str): | |
utils_db_order_ads.db.connect(reuse_if_open=True) | |
# step 0 | |
L_request0 = utils_db_order_ads.Request.select().where(utils_db_order_ads.Request.customer_id == user_id).where(utils_db_order_ads.Request.status != 0) | |
# return len(L_request0) | |
# # step 1 | |
# L_order_ads = utils_db_order_ads.Order_ads.select().where(utils_db_order_ads.Order_ads.user_id == user_id) |
View get list request
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
@router.get("/request",tags=["request"]) | |
def get_request(user_id:str): | |
utils_db_order_ads.db.connect(reuse_if_open=True) | |
# step 0 | |
L_request0 = utils_db_order_ads.Request.select().where(utils_db_order_ads.Request.customer_id == user_id).where(utils_db_order_ads.Request.status != 0) | |
# return len(L_request0) | |
# # step 1 | |
# L_order_ads = utils_db_order_ads.Order_ads.select().where(utils_db_order_ads.Order_ads.user_id == user_id) |
View test
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
``` | |
CREATE USER 'username'@'%' IDENTIFIED BY 'new-password'; | |
FLUSH PRIVILEGES; | |
``` | |
OR | |
``` | |
CREATE USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'new-password'; |
View auto-create-new-image-wordpress-python
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 requests | |
import base64 | |
import slugify | |
# https://github.com/WP-API/Basic-Auth => use API wpv2 | |
url = 'http://newwp.nghiahsgs.com/wp-json/wp/v2/posts' | |
def base_64_encode(message): | |
# message = "admin:password" | |
message_bytes = message.encode('ascii') |
View auto-create-new-post-wordpress-python
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 requests | |
import base64 | |
import slugify | |
# https://github.com/WP-API/Basic-Auth => use API wpv2 | |
url = 'http://newwp.nghiahsgs.com/wp-json/wp/v2/posts' | |
username = '' | |
password = '' | |
def base_64_encode(message): |
View class string
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 String_Interact(): | |
def __init__(self): | |
pass | |
def regex_one_value(self,pattern, input_str): | |
regex1=re.compile(pattern) | |
kq=regex1.search(input_str) | |
if kq: | |
kq=kq.group(1) |
View code_captcha_a_nghiem
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
javascript:var res = prompt("Điền đáp án của captcha tại đây.", "");document.querySelector("#g-recaptcha-response").value = res; |
View gist:4f6273ac59a2ff4226f19807db0c4047
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
systemctl restart sshd |
View gist:1bda6daac4743bde10c4517bc0139154
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
firewall-cmd --add-port=22/tcp --permanent | |
firewall-cmd --reload |
NewerOlder