Categories
Bitcoin Cryptocurrency Mastering Development

Breaking Bitcoin Private Key

Suppose my private key is properly generated. My public key is known to everybody. I don’t care about privacy. How many times can I reuse my bitcoin address until someone has enough information from all my transaction data to break my private key? Assume I operate as an eBay seller who sells USDT (zero loses […]

Categories
Mastering Development

Unsorted Big Data to Train Keras LSTM

I have a dataset I’m working on that is about 2TB in the following form: id | timestamp | cat1 | cat2 | cat3 | … | label | bin1 ——————————————————————- 1 | 04-21-2020 00:12:23 | a | xo | kkl | … | call | 0 1 | 04-21-2020 00:12:31 | b | kk […]

Categories
Mastering Development

Postgress a timestamp column constraint from NOT NULL to NULL

Im trying to run a migration and make basically a column "modified" which is NOT NULL to be NULL. Like there is no need to have that constraint on it, i’ve run yoyo migrations and have the following output psycopg2.ProgrammingError: syntax error at or near "timestamp" LINE 1: ALTER TABLE shop ALTER COLUMN modified timestamp […]

Categories
Mastering Development

Typescript – Custom class lose type after being in array

I’m pushing object that inherit a interface into a typed array of that interface interface MyInterface{} let array = new Array<MyInterface>(); Class MyClass implements MyInterface { //SomeStuff } And when I push this object into the array, they just become [object Object] let obj = new MyClass(); console.log(obj) // –> {//SomeStuff} array.push(obj) console.log(array) // –> […]

Categories
Linux Mastering Development

Setting physical and logical partition types when setting up mount points?

I’m new to Linux and I need help with understanding partition types when setting up mount points. So I’m doing a project where I have to set up mount points for: /boot /var /home swap /tmp / So far, setting up the type of file system, size and options are quite straight forward. However, the […]

Categories
Mastering Development

Convert the difference between datetime.datetime field to seconds

I have a piece of code where I have calulated the time taken for the algorithm to run through datetime as below. begin_time = datetime.datetime.now() #some algo code datetime.datetime.now()-begin_time I expected the output in seconds but it is in some different form as below: 0.000359 I am pretty sure that these are not seconds. How […]

Categories
Linux Mastering Development

How would you recover sudo chmod 0000

How would you recover from: sudo chmod 0000 /bin/chmod on a running system? Describe all possible alternative options you would use to recover from this command.

Categories
Mastering Development

How to turn a string into a dictionary in python

I have a list of strings, where each item in the list is formatted like a dictionary. For example List[0]= {‘time’:100, pages:[1,2,3], size:{red:[1,4,13],blue:[12,432,3]}} However, it is still technically a string. I was wondering how to convert it to an actual dictionary to be able to use the keys to access the values they correspond to. […]

Categories
Linux Mastering Development

I want to compare values of two files, but not based on position or sequence

Suppose that I have the two files with the following content: $ cat File1.txt Apple orange watermelon avocado lime $ cat File2.txt orange Apple lime watermelon avocado Basically, there is no difference, as both have same values. I am using the diff command: diff File1.txt File2.txt and it shows files are different as values are […]

Categories
Mastering Development

Rabbit MQ .Net Client 6.1 – Basic Properties Headers are null

I was previously using version 5 of the .NET client api for Rabbit. I would send me messages with custom header by using code similar to this: IBasicProperties messageProperties = null; lock (connectLock) { messageProperties = this._channel.CreateBasicProperties(); } messageProperties.Headers = new Dictionary<string, object>(5); then I would do a BasicPublish, passing the messageProperties object and message […]