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
# (män, kvinnor), 5-årsintervaller, källa: | |
# https://www.scb.se/hitta-statistik/sverige-i-siffror/manniskorna-i-sverige/befolkningspyramid-for-sverige/ | |
a = [(296183, 280184), (319820, 301335), (325003, 306568), (310539, 292308), (310354, 275136), (342974, 323678), (400939, 379866), (357035, 337476), (331475, 316375), (332100, 320776), (334354, 326130), (344012, 334707), (288783, 286309), (268962, 273778), (255190, 269193), (238376, 259291), (140775, 167556), (69776, 102177), (25990, 52397), (5259, 15730), (425, 2262)] | |
totalt = sum(map(sum, a)) | |
# 6 första intervallerna är 0-4, 5-9, 10-14, 15-19, 20-24, 25-29 | |
under_tretti = sum(map(sum, a[:6])) | |
print(100 * under_tretti / totalt) |
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
# To make a long story short | |
# Install apt source | |
curl -fsSL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo gpg --dearmor --output /usr/share/keyrings/intel-sw-products.gpg | |
echo "deb [signed-by=/usr/share/keyrings/intel-sw-products.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/intel-oneapi.list | |
apt update | |
# Install oneapi | |
apt install intel-oneapi-runtime-opencl intel-basekit clinfo opencl-headers |
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 numpy as np | |
def fib(n): | |
"""Fibonacci using matrix exponentiation""" | |
m = np.array([[1, 1], [1, 0]]) | |
pow_m = np.linalg.matrix_power(m, n) | |
return pow_m[0, 1] |
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
123456 | |
123456789 | |
qwerty | |
password | |
12345678 | |
111111 | |
qwerty123 | |
1q2w3e | |
1234567 | |
abc123 |
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
#!/usr/bin/env python | |
import random | |
things = [ 'chips', 'husdjur', 'demoner', 'jesus', 'popcorn', 'bullar', 'saft', 'ärtor', 'pengar', 'godis', 'kaffe', 'te', 'kebab', 'pizza', 'paket', 'mamma', 'tandkräm', 'gröt', 'AK47', 'proteinshake', 'ägg', 'pannkakor', 'fiskbullar', 'köttbullar', 'spaghetti', 'nudlar', 'flingor', 'apelsinjuice', 'ostmackor', 'havregryn', 'strumpor', 'byxor', 'solrosfrön', 'senap', 'ketchup', 'små rymdgubbar', 'tomtenissar', 'ostbågar', 'rostad majs', 'lillasyster', 'citronbitare', 'fiskpinnar', 'knäckebröd', 'julmust' ] | |
places = [ 'på spisen', 'i ugnen', 'i torkskåpet', 'under sängen', 'bakom soffan', 'på dagis', 'hos rektorn', 'i himlen', 'i hallen', 'i kyrkan', 'i fotöljen', 'i gondolen', 'i Sherwoodskogen', 'i kaffekoppen', 'i blodomloppet', 'i magen', 'i flaskan', 'i badrumsskåpet', 'i toaletten', 'på nätet', 'på toasitsen', 'på golvet', 'på vinden', 'på taket', 'på stolen', 'på hatthyllan', 'på varmvattenpumpen', 'på bänken', 'på båten', 'på steam', 'på ICA', 'på netflix', 'på s |
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
#!/usr/bin/env python3 | |
import sys | |
# Return list of [(min, max), char, password] | |
def read_input(fname): | |
r = [] | |
for line in open(fname).read().splitlines(): | |
a = line.split() | |
a[0] = tuple(map(int, a[0].split('-'))) |
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 xkcd hash | |
echo -n "CorrectHorseBatteryStaple" | md5sum | awk '{ print $1 }' > md5.hash | |
cat md5.hash | |
f6f9b174745fa4651f750c36957d674c | |
# Get 20k wordlist (containing all 4 words) | |
wget https://raw.githubusercontent.com/first20hours/google-10000-english/master/20k.txt | |
# Pick 2k top words to speed up attack: | |
head -2000 20k.txt > 2k.txt |
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
#!/usr/bin/env python3 | |
from z3 import * | |
a, b, p = Reals('a b p') | |
s = Solver() | |
s.add((a / (b + p)) + (b / (a + p)) + (p / (a + b)) == 4) | |
s.add(b != -p) | |
s.add(a != -p) | |
s.add(a != -b) |
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
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c | |
index 97a2200f..ac734bae 100644 | |
--- a/terminal/terminal-window.c | |
+++ b/terminal/terminal-window.c | |
@@ -347,7 +347,7 @@ static GQuark tabs_menu_action_quark = 0; | |
static const GtkActionEntry action_entries[] = | |
{ | |
{ "file-menu", NULL, N_ ("_File"), NULL, NULL, NULL, }, | |
- { "new-tab", "tab-new", N_ ("Open _Tab"), "<control><shift>t", N_ ("Open a new terminal tab"), G_CALLBACK (terminal_window_action_new_tab), }, | |
+ { "new-tab", "tab-new", N_ ("Open _Tab"), "<control>t", N_ ("Open a new terminal tab"), G_CALLBACK (terminal_window_action_new_tab), }, |
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
last commit: 2020-03-04 17:20 +0200 Maxim Ivanov | |
0674b6994 - Error out when not SYSTEMWIDE and john_home_path detected empty (#4218) | |
./configure --enable-ztex | |
... | |
Configured for building John the Ripper jumbo: | |
Target CPU ................................. x86_64 AVX2, 64-bit LE |
NewerOlder