Skip to content

Instantly share code, notes, and snippets.

num_list = [2, 4, 1, 6, 40, 2, 24, 3, 1, 5, 6, 8, 12, 9, 31, 45, 7, 14, 19, 20]
count = 5
paritioned_list = []
for i in range(count-1):
paritioned_list.append(num_list[i*count:(i+1)*count])
two_d_4x4 = [
list(set(first_list).intersection(second_list))
for first_list in paritioned_list
for second_list in paritioned_list
@yzdann
yzdann / five_minutes.yml
Created March 29, 2020 13:59 — forked from ryane/five_minutes.yml
five_minutes.yml
---
- hosts: all
vars:
UBUNTU_COMMON_ROOT_PASSWORD: 'xxxxx'
UBUNTU_COMMON_DEPLOY_PASSWORD: 'xxxxx'
UBUNTU_COMMON_LOGWATCH_EMAIL: [email protected]
ubuntu_common_deploy_user_name: deploy
ubuntu_common_deploy_public_keys:
- ~/.ssh/id_rsa.pub

This is my main.py.

.
.
.
try:
    cmd_type = sys.argv[1]

except IndexError:
    cmd_type = "run"
import datetime
from web_service.models import ServerCves
from web_service.tasks import schedule_server_cve_relations
date_of_core_hotfix_update = datetime.datetime(2020, 1, 12, 0, 0)
broken_servercves = ServerCves.objects.filter(added_date__gt=date_of_core_hotfix_update)
cve_list = broken_servercves.values_list('cve', flat=True).distinct()
broken_servercves.delete()
schedule_server_cve_relations(cve_list)
@yzdann
yzdann / nginx_test.sh
Created January 19, 2020 20:25 — forked from patmandenver/nginx_test.sh
A quick script to test 200, 404, and 500 errors on an nginx box (requires URLs that will result in 200, 404, and 500)
#!/bin/bash
#
# Author: Patrick Bailey
# License: MIT
#
# Set the percentage of 200, 404, and 500 errors you want
# Set the hourly rate you want
# Set a URL for 200, 404 and 500
#
# Then run it. it will suffle the 200, 404, and 500 urls
@yzdann
yzdann / tcp_flags.txt
Created January 19, 2020 08:48 — forked from tuxfight3r/tcp_flags.txt
tcpdump - reading tcp flags
##TCP FLAGS##
Unskilled Attackers Pester Real Security Folks
==============================================
TCPDUMP FLAGS
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere)
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere)
Pester = PSH = [P] (Push Data)
Real = RST = [R] (Reset Connection)
Security = SYN = [S] (Start Connection)
#include "LiquidCrystal.h"
#include "Timer.h"
Timer Count;
// rs, en, d4, d5, d6, d7
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
long rpmcount;
const int hallPin = 2;
int time_now = 0;

yum search

yum info

rpm -qa | grep package

yum repolist

search on epel repo only and you can pipe it with grep package yum --disablerepo="*" --enablerepo="epel" list available

@dataclass
class FieldUpdate
field_name: str
value: Any # ``Any`` and ``Union`` are taken from the ``typing`` module.
invalid_reason: Union[FieldErrors.Unknown, FieldErrors.Immutable, None]
class ModelUpdate:
def __init__(self, model_class, request_body):
updates = []