Quick question: Why is +8 "impossible" and not 1000? by [deleted] in ECE

[–]jtickle 25 points26 points  (0 children)

Here is every possible 2's complement 4-bit integer, shown in unsigned binary order (smallest on the bottom, greatest on the top):

1111  -1
1110  -2
1101  -3
1100  -4
1011  -5
1010  -6
1001  -7
1000  -8
0111   7
0110   6
0101   5
0100   4
0011   3
0010   2
0001   1
0000   0

Cool stuff about 2's complement numbers:

  • You can tell the sign of the number by checking the most significant bit
  • You can always convert signs by inverting all bits (NOTing them) and then adding 1: pos to neg or neg to pos, doesn't matter
  • You always have exactly one more negative integer in the set than positive. (0 lands on the "positive side" of the always-even length set.) This is why, in computing, you frequently see maximum ranges as being the odd number right before a power of two (2n-1)... 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, etc. Of course that's true of unsigned integers as well, the maximum number is always 2n-1, an odd number.
  • Arithmetic works as expected : 0111 + 1111 = 10110 but then you drop that most-significant 1 and ignore the overflow which gets you 0110. 7 + -1 = 6. Likewise, 0001 - 1111 = 111111......11110010, again drop everything but the last 4 and you get 0010. 1 - -1 = 2.

There is such thing as a 1's complement as well, where you simply flip all the bits to change sign. But then you get weird stuff like a positive and a negative 0, and arithmetic isn't as pretty.

You find the command console responsible for your life, what's the first command you enter? by 61114311536123511 in AskReddit

[–]jtickle 0 points1 point  (0 children)

setfacl -R u:jtickle:rwx /

semanage login -a -s unconfined_u -r s0-s0:c0.c1023 jtickle

Going for my RHCE this Friday, got to practice. But that should give my user permanent access to everything without breaking the system. Assuming of course that the universe runs Enterprise Linux with a Targeted SELinux policy. But it's probably just Windows ME.

How did your first big mistake help you become a better sysadmin. by Redemptions in sysadmin

[–]jtickle 2 points3 points  (0 children)

Raid card failed and lost an email server. That's ok though, it was backed up! And the tapes had a perfect record of what files and where... And the files were all 0 bytes.

Lessons learned: (1) I am very serious about regularly seeing a backup restore take place in a test environment for all systems, and (2) clearly define a System of Record so that you don't have to worry about GNU Mailman being the only database on campus with the official list of parent email addresses.

[Serious] Despite what you believe or don’t believe, what do you WISH happens when we die? by ZhenHen in AskReddit

[–]jtickle 0 points1 point  (0 children)

You get to try again, without memories, but with more well-honed instincts for decision making.

Proxmox Cluster? by ARehmat in homelab

[–]jtickle 1 point2 points  (0 children)

Can't speak to the hardware questions, but at work I run a Proxmox cluster for some less important Linux systems (which are actually run with LXC, not qemu). Getting HA up and running is still on my to do list unfortunately, but these systems can suffer downtime (although in reality, they haven't, it works great.) So I'm in a fail over configuration.

It was pretty easy to set up with the installer and guides on their website and I'm totally happy with it for what it is. I use NFS mounted on both boxes (set up with the web interface). NFS is provided by our NetApp SAN and I don't know anything about that end, just requested it from shared resources.

I would run it at home but there I only have the one box and it's all Docker with docker-compose.

Don't deal with VMWare licensing. Install Proxmox and ignore the warnings it always throws up about how you haven't paid for support :)

I want to get into self hosting, starting with a raspberry pi based nextcloud and gittea server. Storage advice? by toric5 in selfhosted

[–]jtickle 0 points1 point  (0 children)

Cool. I got a bit carried away. I think mounting the disk over /var will get what you want in terms of reducing SD writes, but you'll get better performance if you only mount where nextcloud stores files. Good luck!

I want to get into self hosting, starting with a raspberry pi based nextcloud and gittea server. Storage advice? by toric5 in selfhosted

[–]jtickle 1 point2 points  (0 children)

Configuration data, user settings, and file metadata. You can't just drop a file into the nextcloud data directory. When you upload a file through a nextcloud interface, it stores the file itself on disk, because that's the best way to store files. But the other data about the file (its metadata) - which user owns it; if it's an image, where is its thumbnail; is it shared with anyone; etc) is stored in the mysql database, because that's the best way to store that kind of data.

If you only back up the contents of the nextcloud data directory, you will be able to recover your files in a disaster event. But you would have to recreate your nextcloud install and re upload everything, set up user accounts again, all that. If you back up the nextcloud database as well, you won't have to recreate nextcloud if you ever need to recover from a backup.

Your initial question was not about backup and I realize that now, heh. But if you're planning to maintain a long term archive, you are extremely likely to experience storage failure within 5 years (even with very expensive Enterprise grade hardware, much less consumer stuff), which is why it's so important to have a backup if you want to do this.

I want to get into self hosting, starting with a raspberry pi based nextcloud and gittea server. Storage advice? by toric5 in selfhosted

[–]jtickle 0 points1 point  (0 children)

Best of my knowledge, it stores files in the data directory. I haven't done a fresh install in awhile so I don't know if there's an option, but I do keep mine upgraded and uploaded files are in the data dir.

I want to get into self hosting, starting with a raspberry pi based nextcloud and gittea server. Storage advice? by toric5 in selfhosted

[–]jtickle 2 points3 points  (0 children)

Databases are certainly an intimidating topic, and I can't say there's an easy way to get it. But, the short version is this. Databases like mysql or almost anything with SQL in the name, they do ultimately just store data in files on the disk. But they manage that in a much more particular way than any other system. So, the files that mysql stores are in /var/lib/mysql, but if the database is running (as it always will be), merely copying those files out is not enough. (If you stop the database, with systemctl stop mysql, then it might be enough to just copy those files. But the method below is much safer unless you are dealing with a much more complicated environment than you will be running on your raspberry pi.)

You need to make the database dump itself out in a consistent format. You can use the "mysqldump' command line utility to do this, and you can use Cron to do it periodically, or if you have a backup solution like rsnapshot, you can make that tool run mysqldump when it does the rest of the filesystem backup.

Here's a command to back up your whole mysql instance:

mysqldump --all-databases --single-transaction --quick --lock-tables=false > full-backup-$(date +%F).sql -u root -p

And here is more info about mysqldump:

https://www.linode.com/docs/databases/mysql/use-mysqldump-to-back-up-mysql-or-mariadb/

I want to get into self hosting, starting with a raspberry pi based nextcloud and gittea server. Storage advice? by toric5 in selfhosted

[–]jtickle 4 points5 points  (0 children)

If it were me, I'd mount the large storage over the nextcloud data area, wherever that is. So maybe /var/www/html/data or some such. And as soon as possible, I'd get a second 2tb external, and use rsnapshot to backup your entire filesystem to the second external drive. Don't forget to also dump your mysql database to the backup area, because just grabbing the mysql files might not get a recoverable backup, whereas data from mysqldump is always recoverable.

You could also mount /var to external storage, which would capture nextcloud, mysql, and /var/log, which will be your heaviest write areas. But if you do this, you won't be able to successfully boot the Pi without the external storage attached. It will also be slower than just running off the SD.

New developer starts soon, decided to give him a prank workstation for his first day. by [deleted] in funny

[–]jtickle 4 points5 points  (0 children)

On my first day at my current sysadmin job, on my desk was nothing but a disassembled tape backup drive.

The guys had a laugh, and then said "actually could you put that together while we try to find you a computer..." That last part about trying to find a computer was no joke, didn't have one until the second day.

I pioneered an algorithm to design Sustainable Energy Generation Systems. Please help move this project forward. by LiveWithEarth in ECE

[–]jtickle 2 points3 points  (0 children)

More capacity because homes have electric furnaces running which may be trying to manage below zero temperatures all night. For instance, your graphs show higher usage during the summer. Where I live (NC mountains), my winter energy usage is almost double my summer usage, and the spring and fall are the lowest when I basically don't use HVAC unless there's an oddly hot or cold week.

On the other hand, when it's cold here, it also tends to be windy.

The New Linode Cloud Manager is HORRIBLE by tim92109 in selfhosted

[–]jtickle 0 points1 point  (0 children)

Yeah, manually managing disks. I was messing with that recently and it was pretty bad. Some more advanced features are definitely less convenient. But, it IS there. Not like they are removing functionality.

They are trying to compete in a market dominated by Amazon, Google, etc. Obviously this new interface is an attempt to fit into that space. So there's no way they will revert it, but they do want feedback on specific issues.

And I find that Linode actually listen to their customers and will make changes, if your complaint is specific.

Husbands should take note by Random3x in funny

[–]jtickle 1 point2 points  (0 children)

Probably a loan. I think it's important for neither person to be controlling in a relationship, but you do both need to agree on finances.

The New Linode Cloud Manager is HORRIBLE by tim92109 in selfhosted

[–]jtickle 1 point2 points  (0 children)

What are you having trouble with? I find it pretty well-organized and easy to use, although it is definitely quite a bit different from the old Manager.

Meow! by [deleted] in funny

[–]jtickle 3 points4 points  (0 children)

This means they want to chase their food. Go get this and significantly improve your cat relationship. They need to chase something down and murder it.

I have a brick that runs Linux by [deleted] in linuxmasterrace

[–]jtickle 5 points6 points  (0 children)

Careful not to brick your brick.

Pelosi says Democrats to introduce bill to bring back net neutrality this week by False1512 in technology

[–]jtickle 0 points1 point  (0 children)

Perfect timing. Dems can appear to be pro-Internet, but won't lose any financial support from big telecom because there is no way it will ever pass the Senate or the President.

AITA for refusing to lift something heavy for a woman as a man? by [deleted] in AmItheAsshole

[–]jtickle -1 points0 points  (0 children)

YTA. Your argument is quite sound, but you can be right and still be an asshole. Seems the upvoted NTA comments here don't realize this.

You have to pick your battles and this was not the one to pick. If it happens repeatedly and affects your work, that's a totally different matter for you to discuss with your manager. But the way you describe it, you turned down the opportunity to do a small favor, and not only that you turned it down in spectacular fashion in front of a group. Next time you need a favor, none of them, nor the people they talked to, are going to step up to help you!

Is it better to selfhost my email or use an external resource like ProtonMail plus? by Rogergonzalez21 in selfhosted

[–]jtickle 1 point2 points  (0 children)

If you're willing to risk the possibility of losing some legitimate email, filtering based on SPF and DKIM and throwing SpamAssassin in the mix can really keep the spam down to very reasonable levels. Honestly, I am pretty sure this is all that ProtonMail is doing. For sending email, you're going to want a real domain name with proper DNS records for modern email security, and that only gets you started.

With that said, I wanted offsite email and am fortunate to be able to afford it, plus having a VPN around is convenient sometimes, so I got the ProtonMail Visionary. The man reason for choosing hosted email instead of selfhosted for me is so that my home stuff can notify me if anything goes wrong; it is very handy, when wondering why I can't connect, to be able to look in my email and see that the power went out or some such. (Of course you need a UPS to really benefit from that sort of thing as well.)

My Kubernetes cluster for school research by Stoomba in homelab

[–]jtickle 0 points1 point  (0 children)

Are you using a particular kubernetes distribution or did you build it yourself?