Jump to content

Wikipedia:Reference desk/Archives/Computing/2020 May 24

From Wikipedia, the free encyclopedia
Computing desk
< May 23 << Apr | May | Jun >> Current desk >
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.


May 24

[edit]

Making a GitHub repository public

[edit]

Following up on my GitHub project, I recently made my GitHub repositories public after transferring the original projects to them. According to what I have learned, this allows everyone to download the code and try it out for themselves, but not actually modify the repositories.

What surprised me was that GitHub warned me that making a repository public is a potentially destructive action. I would have thought otherwise, making a public repository private would be a destructive action. What is the logic behind this? JIP | Talk 00:38, 24 May 2020 (UTC)[reply]

Well, their use of "destructive" may be a bit of hyperbole, but the warning messages does list the dangers:
  • The code will be visible to everyone who can visit https://github.com
  • Anyone can fork your repository.
  • Your changes will be published as activity.
Also, people can modify their forks of your code and submit them to you as pull requests. If any of these things happen, they may be undesirable to you but they will not damage or even modify your repository. CodeTalker (talk) 16:09, 24 May 2020 (UTC)[reply]
It makes sense if you think of “destructive” as meaning “irreversible”. Sure, you can make the respository private again or delete it, but you can’t do anything about those who saw/copied your repository before you did so. Brianjd (talk) 13:58, 28 May 2020 (UTC)[reply]

SD card problem

[edit]

A 128 gigabyte SD card I bought in Austria last July has recently stopped working. The card can be read just OK both on my computer and on my camera, but nothing ever gets written to it. The camera says "card fault", but the computer (using Fedora Linux) doesn't report any problem. All the files appear to transfer there all OK until I umount the card and mount it again, at which point I find out that nothing was written to the card in the first place. Is there anything I can do about this? Should I send the card to service? I mean, I can read all the pictures I have already taken just OK, but now I have 128 gigabytes of card space I can't reuse. JIP | Talk 00:45, 24 May 2020 (UTC)[reply]

No, other than return or exchange it if it's still under warranty. This is one of the most common failure modes for flash memory. It's unusual for it to happen so quickly, assuming you bought it new, but not impossible. The write circuitry could have developed a fault, or it was used for an unusually-high number of writes—flash memory has a finite number of writes.
Note that what's happening on your PC is the written data is just being stored to the write cache in RAM. Filesystems generally do this by default so the process doing the write isn't frozen waiting for the write syscall to return from the kernel. The kernel then gradually writes to the actual media in the background, unless the cache gets full. Also, of course, when a filesystem is unmounted, any pending writes in cache have to be fulfilled. You could try looking at the dmesg log for messages about failed writes to the card, but depending on settings I don't know if those are logged by default. If you really care you'll have to look into the Linux SD card driver settings. --47.146.63.87 (talk) 01:43, 24 May 2020 (UTC)[reply]
Some "counterfeit" flash cards have a lot less flash memory than they claim, so they work at first, but at some point when they run out of space they return errors. Maybe you have one of those? Dicklyon (talk) 05:07, 24 May 2020 (UTC)[reply]
I recommend getting one of these for $25 USD: SanDisk 128GB High Endurance Micro SDXC Card with SD Card adapter]. At Class 10 / U3 / V30 it is very fast, and Sandisk makes high-quality cards. You can get it in the UK, EUI, AU, etc. by searching for "SDSQQNR-128G-GN6IA". --Guy Macon (talk) 16:23, 24 May 2020 (UTC)[reply]
The card is definitely not counterfeit. I bought it from an electronics store at de:Messepark in Dornbirn, not from some shady street or online vendor. It worked completely fine for almost a year, to full capacity, until it suddenly stopped accepting any writes. JIP | Talk 23:03, 24 May 2020 (UTC)[reply]
It's disappointing that a high capacity card should only fail after a year, but it's not unexpected. I generally regard SDcards and USB sticks as I used to regard floppy disks. Cheaply manufactured, a ubiquitous commodity, and nobody's over-worried much about quality. It's temporary storage. It fails, toss it in the can, buy another 10-pak.
You seem to be using it in the right application, to transfer files taken on your camera to your computer for processing. If I were you, I'd have a box of 10 or so that I can fill up and delay upload, and so that when a few go bad, there's more where that came from.
It might be worth questioning your capacity decision. If you always buy the maximum size one, you'll have more reliability problems and more financial liability when they fail. I haven't purchased one in a while, 128GB was on the large size last time I checked. What maximum size can your camera read? Elizium23 (talk) 06:37, 27 May 2020 (UTC)[reply]

1. Try reformatting the card in a computer, not in the camera. Sometimes that works better. 2. Try for a warranty replacement (they can't be "serviced"). 3. Any card you buy on amazon is likely to be fake because of commingled inventory, so better buy from an authorized direct seller. I like bhphoto.com. 2601:648:8202:96B0:3567:50D5:8BFF:4588 (talk) 04:03, 25 May 2020 (UTC)[reply]

Good point, if it's not too much trouble you might as well try the official SD card formatting program from the SD Card Association: [1]. It can't hurt; of course this will nuke existing data on the card. Complication: they only offer it for Windows and Mac. I have no idea if it works under WINE. Can always borrow a Windows PC for a moment if you have the opportunity, though it does need a user account with administrator access. --47.146.63.87 (talk) 20:55, 26 May 2020 (UTC)[reply]
@JIP: If it's a full-sized SD card, it's probably in write-protected mode.
SD card unlocked and locked
Fezzy1347 (talk) 06:02, 15 June 2020 (UTC)[reply]
No it's not. My camera would have informed me about it. And I just checked the physical switch on the card, it's write-enabled. JIP | Talk 08:25, 15 June 2020 (UTC)[reply]

Compatibility between 3.5mm connectors

[edit]

I have a laptop with a 3.5mm jack that can take headphones with a microphone, and input the sound. I have a recorder with a 3.5mm stereo line out and a 3.5mm stereo headphone out. Can I connect these to get sound from the recorder to the laptop? (My guess is that they are not compatible.) Bubba73 You talkin' to me? 04:49, 24 May 2020 (UTC)[reply]

The stereo output TRS jack/plug cannot correct directly to the TRRS output/input jack, but can be through an adapter such as this one. You may need to reduce the output volume level to be compatible with the microphone input level. Dicklyon (talk) 05:05, 24 May 2020 (UTC)[reply]
Thanks, I ordered one. Bubba73 You talkin' to me? 05:49, 24 May 2020 (UTC)[reply]
Which would be the best output to use, the line level or the headphone level? Bubba73 You talkin' to me? 05:51, 24 May 2020 (UTC)[reply]
First, make sure the line output is controlled by the volume control. On some devices it only controls the headphone level. Then, using the line out (first choice) or headphone out (second choice if the line out doesn't have volume control), start with the output volume very low, then slowly raise it while making test recordings. Stop if you hear distortion. Use the lowest volume that sounds good.
If nothing works without distortion, you may need to search Amazon for "Line to Microphone Attenuator Cable" or "Line to Microphone Attenuation Cable" --Guy Macon (talk) 21:26, 24 May 2020 (UTC)[reply]
Those are about $30! I doubt that the volume control works on the line output. However, I am just passing through the recorder to get a mike input into the laptop, so I can control the volume (of the mike) live. Bubba73 You talkin' to me? 02:52, 25 May 2020 (UTC)[reply]
The problem is that a line output typically has a voltage ranging from 0.5 to 2 volts while a microphone input is expecting roughly 5 to 50 millivolts.[2][3][4][5] It would be a very unusual microphone input that can handle a signal ten to a hundred times higher than a microphone puts out.
Try searching for "Inline microphone Volume Control". --Guy Macon (talk) 04:13, 25 May 2020 (UTC)[reply]
What is the typical voltage for the headphone output? Bubba73 You talkin' to me? 04:42, 25 May 2020 (UTC)[reply]
  • The output specs are:
    • headphone: max 40mW
    • line out: -14dBV.

Does this help decide which to use to plug into the mike input on the laptop? Bubba73 You talkin' to me? 06:03, 25 May 2020 (UTC)[reply]

There really isn't a standard voltage for headphone out, because headphone outputs and other speaker outputs are designed to supply a certain power (milliwatts) and not a certain voltage. I have seen headphone outputs that go as high as plus and minus fifteen volts (30 volts peak-to-peak) with no load (a microphone input acts like no load), but it is more common to see a peak-to-peak voltage equal to the output voltage of the battery or batteries. But you wouldn't set it at max volume, so the real question is how many volts it puts out at the lowest non-zero volume setting. Just try it. You won't damage anything if you stop raising the volume when you hear distortion. Hooking a headphone output into a microphone input is so easy to do that nobody designs mic inputs that can't survive it -- but the signal may be very distorted. --Guy Macon (talk) 06:12, 25 May 2020 (UTC)[reply]
I'll try it when the part I ordered comes in. Bubba73 You talkin' to me? 06:29, 25 May 2020 (UTC)[reply]

I got the part in and it works. Bubba73 You talkin' to me? 04:11, 30 May 2020 (UTC)[reply]

Manual install of a Linux application

[edit]

Is there a way to install a program at a linux kernel os without package managment program or having the source code of the program you want to install at your hands?2804:7F2:591:ADF2:456C:D9BC:B019:47F0 (talk) 17:07, 24 May 2020 (UTC)[reply]

Yes, you can do that. It is not uncommon for some binaries to be distributed via a tar file which you then unpack and run. RudolfRed (talk) 19:58, 24 May 2020 (UTC)[reply]
Yes, there are plenty of ways to do what you propose, but when you make an end-run around the package management software, you often get bitten by it later. Can we ask why you want to do what you are trying to do? Elizium23 (talk) 20:01, 24 May 2020 (UTC)[reply]
Echoing the other replies, yes, but there's often not a great reason to. There's nothing magical about an "install"; it's just a process of unpacking any compressed files, copying files, and often related tasks like adding shortcuts to a desktop menu. The point of a package manager is it automates all this, keeps track of files, and lets you easily uninstall and update programs. If a program isn't available in whatever package manager you're using, you should check whether there are third-party repositories that have it available. Failing that you can write your own install script for the program or request that someone else do it. If you just want to learn more about how all this stuff works, you should probably start by reading some documentation for your package manager and distro, and then maybe start reading up on things like GNU autotools, which is what a lot of FLOSS software uses for its install process. Linux From Scratch is a great learning experience if you're willing to invest some time in it. Do it in a virtual machine for convenience. --47.146.63.87 (talk) 22:18, 24 May 2020 (UTC)[reply]
I will tell you why I personally will refuse to install software that is not prepackaged for my Linux distribution. Because packaged software is vetted (we hope) and receives security updates into the future. There is not really a virus scanner on Linux, per se, but we guard against malware in other ways. One of those ways is by using the package manager. The developers in charge of our OS who package software have a solemn duty to protect us from security vulnerabilities, and the system works pretty well. If they release a package, we can rest assured it's been under scrutiny a bit, and any further scrutiny that results in them discovering a problem, they release an updated package and we can take immediate advantage of that by installing updates.
We see this model with mobile devices and the Apple/Google Play store. These vendors have a very good reason to prevent devices from "sideloading" apps from unauthorized sites. Apple and Google expend a lot of energy vetting the apps that go into their stores, so that they adhere to standards and are verified to be secure and malware-free.
This is a facility that we shouldn't sidestep lightly. If you have a personal system and you have some software you absolutely need for work or something and you just want to slap it on there, then OK. But I would generally question the motives and goals of someone who is trying to install "mystery software" without a package in hand. Just my $0.02 as a systems admin of over 30 years. Elizium23 (talk) 06:26, 25 May 2020 (UTC)[reply]
Also, even if we wanted to help you, the answers for "how to do it" are as varied as the types of software out there. In general, you need to copy the right files to the right system locations and set the correct permissions. Those variables are determined by what the software is and what it does and who needs to run it, etc. So we cannot furnish help in a generic sense here unless you wanted to reveal the software and its structure. Elizium23 (talk) 06:31, 25 May 2020 (UTC)[reply]
"In general, you need to copy the right files to the right system locations." Cant you have an installer and stuff like that like in windows, that you can download from a site, get from torrent, get from peer 2 peer program, get from a pendrive/cd/dvd/floppies/external hd, receive thought e-mail or get from network folder....?2804:7F2:591:ADF2:34F5:F91D:932C:1ADD (talk) 00:13, 26 May 2020 (UTC)[reply]
Yes, that is what package managers are for - they usually use .deb or .rpm files. Ed6767 (talk) 00:15, 26 May 2020 (UTC)[reply]
There are self-contained installer files and their file extension is usually ".bin". They typically work by having a shell script at the top and a tar.gz file in the rest of the file. So it is a self-extracting program. The developer may only take advantage of the self-extracting nature and give you the files, or he may build installer logic into the script file. However, note well that this is also bypassing package management, and leaves your system in a less-than-ideal state. But it is certainly done all the time. I used it for my printer drivers when the repository's version was broken. Elizium23 (talk) 06:23, 27 May 2020 (UTC)[reply]