This file contains hidden or 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/python3 | |
| # text input | |
| txt = list(input('Enter text: ').upper()) | |
| # first title | |
| print('---------------') | |
| print('Pythagorean') | |
| print('---------------') | |
| # key value pairs of letters with their associated numbers (Pythagorean) | |
| nums = { | |
| 'A': 1, 'B': 2, 'C': 3, 'D': 4, 'E': 5, 'F': 6, 'G': 7, 'H': 8, 'I': 9, |
This file contains hidden or 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 os import listdir | |
| from subprocess import run | |
| def cpu_vuln_info(): | |
| print('\x1b[1;96m===== Vulnerabilities =====\x1b[0m') | |
| vulns = listdir("/sys/devices/system/cpu/vulnerabilities/") | |
| for vuln in vulns: |
This file contains hidden or 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/python3 | |
| import subprocess | |
| track_links = { | |
| "1": [" Shamanizm Parallelii - Strange Food For Strange People From Fairy \ | |
| Tales Part 3: Dub | Full Album", | |
| "https://www.youtube.com/watch?v=4UWJBdPm2dA"], | |
| "2": [" Vena Portae - Underwater Remixes | Full Album", | |
| "https://www.youtube.com/watch?v=oVrFkqiUlbg"], |
This file contains hidden or 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/python3 | |
| # random mac address generator --> aa:f4:25:c5:0e:2e | |
| from random import randrange as rr | |
| import subprocess | |
| # Organizational Unique Identifier list | |
| oui = [ | |
| "F4:BD:9E", "94:E6:F7", "40:55:82", "A4:E3:1B", "98:E7:43", "4C:1D:96", | |
| "10:32:7E", "30:FB:B8", "68:DB:F5", "24:46:C8", "44:D7:91", "84:46:FE", |
This file contains hidden or 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/python3 | |
| # used Python 3.6.8 to access LXD container attributes | |
| from pylxd import Client | |
| client = Client() | |
| container = client.containers.all()[0] | |
| print(f'\033[36;1marchitecture\033[0m') | |
| print(f'{container.architecture}') |
This file contains hidden or 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/node | |
| const brew = n => { | |
| const wkDayNum = new Date().getDay(); | |
| const wkDayName = new Intl.DateTimeFormat('en-US', { weekday: 'long' }).format(Date.now()); | |
| o = { '0': ['8', '28'], '1': ['6', '20'], '2': ['8', '14'], '3': ['6', '6'], | |
| '4': ['6', '48'], '5': ['8', '42'], '6': ['6', '34'] }; | |
| return `${wkDayName}\nbrew: ${o[wkDayNum][0]}\nremain: ${o[wkDayNum][1]}`; | |
| }; | |
| console.log(brew()); |
This file contains hidden or 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
| const solve = (y1, y2) => { | |
| let c = 0; | |
| let m1 = []; | |
| let m2 = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; | |
| for (let i = 0; i < (y2 - y1 + 1) * 12; i++) { | |
| d1 = new Date(y1, i, 1); | |
| d2 = new Date(y1, i + 1, 0); | |
| if (d1.getDay() === 5 && d2.getDate() === 31) { | |
| m1.push(d1.getMonth()); | |
| c++; |
This file contains hidden or 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/python3 | |
| '''Convert letters to NATO phonetic alphabet.''' | |
| _INPUT = input('Enter letters: ') | |
| def convert_nato(): | |
| d = { | |
| 'A': 'Alpha', 'B': 'Bravo', 'C': 'Charlie', |
This file contains hidden or 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
| const toLeetSpeak = s => { | |
| h = { | |
| A: '@', B: '8', C: '(', D: 'D', E: '3', F: 'F', G: '6', H: '#', I : '!', | |
| J: 'J', K: 'K', L: '1', M: 'M', N: 'N', O: '0', P: 'P', Q: 'Q', R : 'R', | |
| S: '$', T: '7', U: 'U', V: 'V', W: 'W', X: 'X', Y: 'Y', Z: '2' | |
| } | |
| return s.split('').map(x => h[x] || x).join('') | |
| } |
This file contains hidden or 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
| const sum = x => y => z => x+y+z | |
| console.log(sum(1)(2)(3)) // 6 |