Jump to content

Wikipedia:Reference desk/Archives/Computing/2016 March 2

From Wikipedia, the free encyclopedia
Computing desk
< March 1 << Feb | March | Apr >> March 3 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


March 2

[edit]

lastlog on raspberry pi (raspian)

[edit]

Hello,

a server running raspian crashed, and I wanted to make sure nothing sketchy was going on. I noticed that lastlog showed root as having last logged in about 1 year ago, but I did not install the OS until about 3 months ago. Is this weird? Of my 3 pis running raspian, 2 of them have this while the third shows what I would expect, which is "Never logged in". Any tips? 216.15.23.2 (talk) 03:21, 2 March 2016 (UTC)[reply]

Some countries have consumer protection laws that allow consumers to return products (especially products they've ordered online). The manufacturer of those products may be allowed to sell them again. The Quixotic Potato (talk) 06:58, 2 March 2016 (UTC)[reply]
However, are you sure the RTC was set to the correct date every time you did log in? Nil Einne (talk)
Actually reading more carefully, it sounds like perhaps you believe you never logged in as root? Nil Einne (talk) 16:45, 2 March 2016 (UTC)[reply]
It is hard to login as root without some messing around because I don't think there is a root login/password. The default user is 'pi' - and it's one of those systems that's setup to work with 'sudo' instead of logging in as root. SteveBaker (talk) 18:15, 2 March 2016 (UTC)[reply]
Thats correct, its supposed to be sudo based. 216.15.23.2 (talk) 06:27, 3 March 2016 (UTC)[reply]
When I bought my most recent batch of Raspberry Pi 2's, they each needed a blank memory card that I had to load myself. I don't see where they sell them with pre-loaded OS's. So the idea that you somehow got a 'used' RPi that hadn't been erased seems v.unlikely and I don't think The Quixotic Potato is correct.
I suspect that the log trace comes from the person who put together the Raspian release bundle. Quite often you do this by setting up a machine with the right files - you test it - then you zip up the entire memory card and post the contents for online download. In that scenario, what you're seeing is probably the last login by the person who checked out the release prior to greenlighting it. It seems a little sloppy to do it that way, but we're not talking about big, organized businesses putting together these releases - so I'm not entirely surprised.
I'm guessing that the RPi that's different has a different history of operating system installs (eg had an older release than the other two - but was then upgraded with 'git upgrade' or something).
I love the RPi - it's an insanely good deal (esp. the Pi Zero!). But I've seen many, many instances of somewhat sloppy stuff going on in the RPi world. Items are often poorly described (I bought a case for one of my RPi-2's but there was no mention that it's designed for RPi-1's and doesn't fit the 2's...I bought a camera board and in the specification, there are contradictions between the vertical extent of the region is can see at some given range and the vertical field of view measured in degrees...the IR camera comes with a blue filter - no two people seem to agree on what it does, and the Amazon and AdaFruit descriptions of it disagree...when I asked both organizations about it - each one claims the other is incorrect!). Many things are undocumented (the camera API has a 'hello world' example program - but for anything other than that it's "here's the source code - you can read it!"). But if you want "cheap" and "capable" and "open-source" then you have to accept that these kinds of thing are going to happen - and contribute your findings back into the community so they can get fixed.
Most of the time, it's not a real problem - but if you're trying to do something very serious with them - and you really care about things like when the last root access was - then you're going to hit these kinds of things repeatedly.
SteveBaker (talk) 18:12, 2 March 2016 (UTC)[reply]
Thats what I was thinking, something like a oem type of install that was not cleaned up properly. The one that did not have the root account was a bit older, but it was also one where I flashed it myself, as opposed to just using one of those 'noobs' installs. I think there was one I did not flash myself, but the explanation above makes sense and I have not seen anything suspicious besides one of the pis crashing recently (under heavy load though). Thanks for the comments! 216.15.23.2 (talk) 06:27, 3 March 2016 (UTC)[reply]

can DB UUIDs used as PKs cause many page splits slowing down insertions?

[edit]

I read so, but UUIDs are fix-length, aren't they? Thanks — Preceding unsigned comment added by 81.149.14.196 (talk) 12:00, 2 March 2016 (UTC)[reply]

I could easily give a very long historical answer, but it boils down to this: Fixed-width columns don't make a different in modern database engines. Everything is logically variable-width. UUIDs are nowhere near the block/extant/chunk size that is used to reserve space for tables. So, even with UUIDs, you can put many rows in a single block/extant/chunk. 209.149.114.145 (talk) 19:49, 2 March 2016 (UTC)[reply]
thank you --85.118.11.241 (talk) 07:54, 3 March 2016 (UTC)[reply]

thunderbird -remote "xfeDoCommand ...

[edit]

[Moved from RD/L] Tevildo (talk) 22:12, 2 March 2016 (UTC)[reply]

I am trying to send an email from the command-line, using thunderbird. Following command:

 thunderbird -remote "xfeDoCommand(composeMessage,subject='the subject',to='me@somesite.com',body='message   \ body',attachment='~/somefile.txt')"

is able to create a new email with subject, body, to-field, and attachment. However, I still would have to press the 'send' button. How can I run a command that would send the message too?

--Scicurious (talk) 22:05, 2 March 2016 (UTC)[reply]

Do you really have to use Thunderbird? Thunderbird is designed as a GUI client. There are plenty of command-line e-mail clients out there. On Unix systems (including most Linux distributions and I think Mac OS X) there's often one already installed under /bin/mail or /usr/bin/mail. Plugging something like "command line email" into a search engine will give you a bunch of information. --71.119.131.184 (talk) 22:19, 2 March 2016 (UTC)[reply]
I'd prefer to keep using Thunderbird, which already has my credentials saved. Maybe there is an easy way of pressing that button. Otherwise, I'd try mail or sendmail.--Scicurious (talk) 22:30, 2 March 2016 (UTC)[reply]
I never solved that problem, but Thunderbird is open source. You might create Your own spam speading machine from the source. But, refereing the license, You need to publish You modifications! Using Windows, there are 3rd party commandline tools, creating and sending emails from text files. It might be an idea to save a composed draft from Thunderbird for use as a form. --Hans Haase (有问题吗) 12:02, 3 March 2016 (UTC)[reply]
There is no command line option to send a message. You can use -compose message_options to have it bring up the compose message window and fill in everything for you, but you still need to press the Send button to actually send the message. You can use a simple scripting language like AutoIt to press the button for you. The Quixotic Potato (talk) 18:21, 3 March 2016 (UTC)[reply]
@Scicurious: Here an example script. If you open Thunderbird and click on the New message button to send an email and type the word "test" as the subject line - then what is the title of that window? :For this example I have assumed that the title of the window starts with the words "New message" (case-sensitive), but maybe the title on your "New message"-window is different. This AutoIt script checks every second if a window with a title that starts with the words "New message" exists, and if it does it sends the keycombination Control+Enter to the window (which will send the email).
$title = "New message"
Do
	If WinExists($title,"") Then
		Sleep(3000)
		ControlSend($title,"","","^{ENTER}")
        Else
                Sleep(1000)
	Endif
Until 1 <> 1
The Quixotic Potato (talk) 23:01, 3 March 2016 (UTC)[reply]

Why does Wikipedia appear different on different computers?

[edit]

I don't know all that much about computers (the technical stuff and what-have-you). So, pardon me if this sounds like a "dumb question". Why is it that when I am on different computers, Wikipedia looks completely different? Especially when an article has charts and tables. Sometimes, it looks (aesthetically) great. On other computers, it looks like a patchwork mess. Such a mess, it's even hard to read. Why is this? I don't think I've ever experienced this with any other websites. Thanks. Joseph A. Spadaro (talk) 23:38, 2 March 2016 (UTC)[reply]

Different browsers (not computers) will render the same page differently. They will also have different fonts installed, which contributes to the problem that you mention. I don't expect to find a mess using an updated browser, though. --Scicurious (talk) 01:46, 3 March 2016 (UTC)[reply]
What is a browser? Do you mean Mozilla Firefox? All of my computers use Mozilla Firefox. So, if all of my computers use Mozilla Firefox, how is it the browser -- but not the computer -- that is causing the problem? Also, my Mozilla Firefox is completely up-to-date, nothing outdated at all. And, also, why does this occur only with Wikipedia? I haven't noticed it with any other websites. Thanks. Joseph A. Spadaro (talk) 04:16, 3 March 2016 (UTC)[reply]
The most likely culprit is different screen or window size. Wikipedia, like most good websites, has a dynamic layout, i.e. the browser rearranges the different elements of the page to fit the browser window. Many other websites have a fixed layout, so that they can guarantee enough space for ads, or because they have a designer who does not understand the web, or because (like me sometimes ;-) they use lousy tools. In that case, the layout is always the same, but you get scroll bars or white space padding if the window is to small or too big. --Stephan Schulz (talk) 08:34, 3 March 2016 (UTC)[reply]
It's also surprisingly easy to have to seemingly identical instances of Firefox actually use slightly different settings. If OP wants to rule out differences in Firefox settings, here [1] are instructions on how to pass preferences and settings between the different instances. SemanticMantis (talk) 16:09, 3 March 2016 (UTC)[reply]

Well, all of my computers do have different sized screens (monitors). So, is that the issue here? Joseph A. Spadaro (talk) 18:34, 3 March 2016 (UTC)[reply]

It *could* be. It *could* be that you have plugins installed in some browsers and not others. It *could* be that you have custom settings in some browsers and not others. It *could* be that you have different font settings on some computers and not others. It *could* be many many many things. It is a bit silly to ask specifically what the problem could be. 209.149.114.145 (talk) 18:48, 3 March 2016 (UTC)[reply]
In the unlikely event that you unaware of this, your answer is very unhelpful. Anyway ... I install Firefox and then I do nothing further. So, it would seem to me that I have the same version of Firefox on all of my computers. I never go in and change preferences, fonts, plug-ins, etc. I wouldn't even know how to, even if I wanted to. Joseph A. Spadaro (talk) 02:04, 4 March 2016 (UTC)[reply]
It could be, but it's hard to be sure because all we've got to go on is that you say that it's a mess. Taking a few screen-caps might help us understand what you're seeing and we could work from that to better answer your question. You might also get better (or at least different) answers on the help desk. Matt Deres (talk) 18:51, 3 March 2016 (UTC)[reply]
I was thinking of screenshots. But, alas, I don't know how to do them. So, verbally, here is an example. They (the problems) typically show up in charts and tables. On a computer with a bigger screen, the charts look nice and neat. On a smaller screen, the tables have less aesthetic appearances. For example, let's say that a column heading is "Date of Birth". On a bigger monitor computer, that will look fine. On a smaller computer, maybe it will be "squeezed" to a skinnier column where it will say "Date" and then below that "of" and then below that "Birth". That's an example. Joseph A. Spadaro (talk) 02:15, 4 March 2016 (UTC)[reply]
Here's maybe a better example. Look at my Home Page here: User:Joseph A. Spadaro. On a bigger-screen computer, all of my "User Boxes" will appear in perhaps two rows of twelve boxes (columns) each (or some such). On a smaller-screen computer, all of my "User Boxes" will appear in perhaps eight rows of three boxes (columns) each (or some such). Maybe that's a better example. Help! Joseph A. Spadaro (talk) 02:32, 4 March 2016 (UTC)[reply]
Seriously? I see at most seven columns in 1920 pixels. —Tamfang (talk) 05:32, 4 March 2016 (UTC)[reply]
I just double-checked and counted. On my "big" computer, I see nine columns across. And two rows down. The first row starts with the box "I have been on Wikipedia for 9 years" and ends with the box "I am Roman Catholic". The second row starts with the "Mensa" box and ends with the "Classical Music" box. I have no idea to tell how many pixels my computer screen/monitor is. Joseph A. Spadaro (talk) 07:48, 4 March 2016 (UTC)[reply]
It's natural for a wider window to show more per line. You haven't said whether you see problems like excessive whitespace or bad font sizes. As NorwegianBlue says below, Firefox (and several other browsers) can zoom in with Ctrl++ and out with Ctrl+-. You can reset the size with Ctrl+0. Wikipedia likes informative tables with many columns so it's expected that some of the columns become very narrow on narrow screens and don't have room for "Date of Birth" on one line. I think it's better to wrap such lines than force the table to be wider than the screen so you have to use a a horizontal scroll bar to see the right part. PrimeHunter (talk) 14:56, 4 March 2016 (UTC)[reply]
I doubt the screen size is to blame. Even at 10 inch, the pages should be not be scrambled. The screenshot would help in the diagnostics. Otherwise, we could only put the blame on the butler for changing the settings. Scicurious (talk) 18:56, 3 March 2016 (UTC)[reply]
Try changing the browser resolution, and see what happens. You do this in Firefox by holding the ctrl-key, and typing plus or minus on the numeric keypad. --NorwegianBlue talk 14:24, 4 March 2016 (UTC)[reply]
Looking at the userboxes, I change the browser resolution by holding down the Contr- key while turning the scroll wheel of the mouse. This is with Windows 10 and both Opera and Firefox. This method can adjust the display of userboxes, which are in four columns in my most-used resolution, to make them anywhere from 19 columns down to a single column of boxes. These extremes are unpleasant to my eye, but they all work. Wikipedia tables often conflict with pictures, depending on the browser resolution and sometimes on the particular browser. Sometimes only an extreme resolution can look somewhat good. In those cases I assume many readers will have this problem. I go into "edit source" to adjust the picture's size and position so as to look good on more than one browser at several resolutions. When the table itself shows poorly, I don't bother as table adjusting is more difficult for me than picture adjusting. Jim.henderson (talk) 16:38, 4 March 2016 (UTC)[reply]

Thanks, all. Yes, I guess it must be the size of the monitor and the screen resolution. Thanks. Joseph A. Spadaro (talk) 17:40, 5 March 2016 (UTC)[reply]