Nothing fancy, just a personal log with a built in search function so I can recall what is easily forgotten.
Monday, August 15, 2022
Friday, August 5, 2022
Python Dynamic Numbered Variables in Loop
I am probably doing this in the most inefficient way possible, but the code is simply to demonstrate how to run through a counter and add the number incrementally on to the end of a variable. For instance I just want to add a number at the end of string "a" and read the variable "a1" through "a4".
#Putting string literal of numbers into an array separated by spacesa1 = "3".split(" ")
a2 = "7 4".split(" ")
a3 = "2 4 6".split(" ")
a4 = "8 5 9 3".split(" ")
#print(a1[0])
sum = 0
y = 1
x = 0
#Read each of the above "a" variables 1 through 4
while y < 5:
if y == 1:
# sum = a1[0]
sum = locals()[f"a{y}"][x]
else:
# if a2[0] >= a2[1]
if locals()[f"a{y}"][x] >= locals()[f"a{y}"][x+1]:
sum = sum + locals()[f"a{y}"][x]
else:
sum = sum + locals()[f"a{y}"][x+1]
x+=1
y+=1
print(sum)
# output is 3749
sumint = 0
for i in range(0, len(sum)):
sumint = sumint + int(sum[i])
print(sumint)
# output is 23
# the last step of sumint could have been saved by using
# int(locals()[f"a{y}"][x])
Saturday, July 30, 2022
Life in Python Recursive
def life(years):
while years > 0:
return life(years-1)
years = 110
life(years)
Sunday, July 10, 2022
Python Fibonacci
fibs = []
for i in range(20):
fibs.append(i) if (i==0) or (i==1) else fibs.append(fibs[i-1] + fibs[i-2])
i += 1
print(fibs)
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181]
Monday, June 6, 2022
Change an Image Background to Transparent
Wednesday, April 27, 2022
Tails OS and Cryptocurrency Wallet
What I want is a cold wallet that is detached from the internet.
Since I am a geek, I do not want to purchase a cold wallet like the ones at https://www.guru99.com/best-crypto-cold-wallets.html
Instead, I would like to create a USB wallet, which turns out to be simply a live OS that has a crypto wallet installed.
List of components:
Once again BalenaEtcher flashes the USB successfully, but the USB is not bootable. Now I must fix the USB drive, so search for "diskpart" on this blog for instructions.
After cleaning and repartitioning using diskpart, I then reformatted the USB drive through Windows with NTFS as the format.
I will now trying creating a bootable USB drive with https://rufus.ie/en/#google_vignette
After Rufus succesfully flashed the USB drive, I held down the [Shift] key and clicked Windows Restart
Voila! Tails booted from the USB drive. Now on to creating persistence and installing a cryptocurrency wallet.
Sunday, April 24, 2022
Kali Linux - Failed to Launch Preferred Application for Terminal Emulator
This fixed it:
sudo apt install xfce4-settings



