Categories
Ask Chemistry

Can heavy water be distilled using solar energy?

So heavy water, or D2O, or less commonly known as deuterium oxide, is a substance used in heavy water reactors and also as a source of deuterium gas (through electrolysis) for fusion research. Light water (H2O), of course, has a boiling point of 100°C, whereas heavy water (D2O) has a boiling point of 101.4°C. Obviously […]

Categories
Cryptocurrency Ethereum Mastering Development

Fast sync ain’t fast enough

I’m running geth with –syncmode=fast –cache=4096 –maxpeers=50 My laptop runs like crazy, but it’s never able to reach the top of the chain (blocks are at the moment been created ~ once every 14 secs). I’m running this from the geth console: function status() { console.log("diff states"); console.log(eth.syncing.knownStates-eth.syncing.pulledStates); console.log("diff blocks"); console.log(eth.syncing.highestBlock-eth.syncing.currentBlock); console.log("peers"); console.log(net.peerCount); }; I’m […]

Categories
Linux Mastering Development

Can’t SSH because pam_exec.so script is not executable

So I’ve added a few post login scripts on my /etc/pam.d/sshd as follows: # Post Login Scripts session required pam_exec.so /etc/pam_scripts/login-logger.sh session required pam_exec.so /etc/pam_scripts/storage.sh But I’ve forgotten to make them executable (so stupid) and now I just can’t SSH into the machines because these files are "not found", like below: /etc/pam_scripts/login-logger.sh failed: exit code […]

Categories
Linux Mastering Development

No wireless interface on Debian 10 (Asus X502C)

I just installed Debian 10 on a Asus X502C laptop and can’t see wireless interface. It previously had a Win/Ubuntu dual boot and the WiFi worked fine. uname -a Linux debian 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64 GNU/Linux ifconfig enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.89 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 2600:1700:5390:5ca0:76d0:2bff:fe08:d3d6 prefixlen 64 scopeid […]

Categories
Linux Mastering Development

Dovecot cache files get corrupted repeatedly. How do I make it stop?

I get this message from Dovecot all the time: Error: Corrupted record in index cache file Getting rid of the caches and restarting fixes it for a time, but then it gets corrupted again. How can I make it stop? I’m using dovecot 2.3.10.

Categories
Linux Mastering Development

Alternative to du threshold

I am looking for a way to search directories larger than a specific size. I found the following, which works perfectly: # du -sh /var/log/ –threshold=5G 5.3G /var/log/ The problem is that –threshold only seems to be supported in Ubuntu, as when I try on CentOS for example, I get: # du -sh /var/log/ –threshold=5G […]

Categories
Linux Mastering Development

Grep all lines with one specific character

I want to grep all lines with only one "#" in a line. Example: xxx#aaa#iiiii xxxxxxxxx#aaa #xxx#bbb#111#yy xxxxxxxxxxxxxxxx# xxx#x #x#v#e# Should give this output xxxxxxxxx#aaa xxxxxxxxxxxxxxxx# xxx#x

Categories
Linux Mastering Development

Save files to be deleted by rsync on a directory

I have a cronjob running every 2 hours a script containing a few rsync job to sync my pc to my homeserver. Most lines look like this one (some have –exclude arguments): rsync -e ssh -a –delete –log-file={LOG_FILE} {LOCAL_DIR}/src/ {REMOTE_SERVER}:{REMOTE_DIR}/dest/" I would like to save on the destination machine a copy of deleted/changed files, in […]

Categories
Mastering Development

Pandas dataframe – How to sort (alphabetically) column values with value_counts

I am trying to sort dataframe column values in conjunction with value_count – Below is a code snippet of my algorithm: with open (f_out_txt_2, ‘w’, encoding=’utf-8′) as f_txt_out_2: f_txt_out_2.write(f"SORTED First Names w/SORTED value counts:\n") for val, cnt in df[‘First Name’].value_counts(sort=’True’).iteritems(): f_txt_out_2.write("\n{0:9s} {1:2d}".format(val, cnt)) Below is the first few lines of output – note that "First […]

Categories
Mastering Development

Restricting Xcode 12 to Swift 5.2

I’d like to use Xcode 12 Beta to develop a iOS 13 app because of the vastly improved error messages for SwiftUI. Unfortunately, there are features in Xcode 12/Swift 5.3 that will not compile on Xcode 11, for example: class SomeViewController : UIViewController { func bar() { UIView.animate(withDuration: 1) { [self] in foo() } } […]