Help Bites



  • @Gąska said in Help Bites:

    @aitap FTP server?

    In different circumstances, I would also suggest WebDAV (since all modern OSes are supposed to speak it natively, right?), but I don't think I can make it mostly work in one click on arbitrary computers belonging to people I can't visit or support remotely. If installing software on all involved computers and teaching people to use it was an option, something like FTPS or WebDAV or SFTP would be viable: it's just a matter of configuring the client to auto-connect and don't ask stupid questions. Here, much as I don't like it, web UI seems to be the way.

    @Tsaukpaetra said in Help Bites:

    HFS by rejetto should have you covered!

    HFS is great! Not looking forward to reverse-proxying it to make it run on a long, unguessable HTTPS address, but it could be an option. One of my servers could run it, sure.

    @Gąska said in Help Bites:

    some open sores FTP server with web frontend, right?

    For some reason, those seem to be all written in PHP many years ago. But hey, this is an option too! There's probably a way to prevent this from asking stupid questions like login and password, and hiding it behind a hard-to-guess URL is easy.


  • Notification Spam Recipient

    @aitap said in Help Bites:

    a long, unguessable

    Security theater?



  • @Tsaukpaetra said in Help Bites:

    Security theater?

    Well. Perhaps my constraints are :trwtf:, but long, unguessable "invite URLs" seem to be the best-fitting solution. After all, Google Docs seem to work the same way when inviting a someone who doesn't have a Google account to work on something.

    Sometimes, in a few days Google starts asking to create an account for "security reasons", but that's another story.

    1. The people involved are bad with passwords, so letting them create their own usernames/passwords is just asking for trouble. Passwords will be forgotten. Usernames will be forgotten. It will also be forgotten how to switch from the "password reset letter has been sent" tab to the webmail tab to continue the password reset process. "I wanted to reset the password, but now it's asking me for one. Is it the old one or the new one? There's two inputs on the form, so it must be both, and I don't remember one of them." "I'm sick of having to come up with passwords! You IT people know I'll forget them anyway, why don't you come up with something better?" Note that the link in the password reset e-mail becomes a de-facto invite URL, but more complicated. This includes anything that requires an account, except their work e-mail that they depend upon so much that they had to overcome the pain of having to access it from anywhere.
    2. Full read-write access at the root page of https://cloudstorage.whatever.example/ isn't a good idea, either. Some bot will probably find the website and start filling forms, so that by the time I check on the website the following morning, it would have been used as file storage to distribute ransomware payloads, 419 scam documents and terrorist propaganda.

    So I have to somehow filter for legitimate users, but I cannot trust them to remember anything. (Or their computers. Cookies will be cleaned accidentally or to solve intermittent problems with Moodle/Blackboard/whatever. Laptops will be swapped because webcam is broken but they need to give a lecture now or because they went to the cottage for the duration of the lockdown and have a different computer there.) Putting the "password"access token in the URL seems to be an acceptable trade-off between security and convenience. They'll bookmark it, memoise the procedure of finding the link in their inbox and clicking it, or copy-paste the link in a dedicated Word document on their desktop, and have their access to the files. In turn, the website won't let anyone in who doesn't have a valid token in the URL.

    I only need to protect against non-targeted attackers. They will go away because they don't have a valid access token and the possible token space is too large to guess by brute force. A targeted attacker probably has tens of ways of accessing users' data already.

    Maybe I hadn't formulated my problem well enough in my previous message. Is there a better solution to what I've described here?


  • Notification Spam Recipient

    @aitap said in Help Bites:

    Is there a better solution to what I've described here?

    I dunno. Literally nobody has found my Photos archive located in /Pictures at the root of my own domain, so unless you make yourself more Google-searchable than me I don't know how secure you really wanna go...



  • Nice try, but no one here is foolish enough to fall for your :bait:


  • Discourse touched me in a no-no place

    @aitap said in Help Bites:

    So I have to somehow filter for legitimate users, but I cannot trust them to remember anything.

    This sort of thing is why you use OpenID if you can. Like that, the user doesn't really have to remember very much and most resource operators don't have to worry much about users' bad password habits.



  • Looking for a simple wiki solution.

    Basically it'd be for ~4 or so users and mainly for keeping notes, so quite low traffic. One of the concerns is that it should be relatively low effort to use. It's unlikely we will get any assistance from IT for setting it up, so it'll either have to be hosted somewhere else or be super low effort to setup & maintain. We don't plan to let any non-engineers/developers near it, so a competent markdown/whatever editor is preferred over a janky WYSIWYG editor.

    Solutions that have been brought up so far:

    • Use a github repo wiki. Advantage: everybody already has an account there anyway. Hosted on Github with all the implications that has. None of us have used Github wikis exhaustively, so we're not sure what limitations there are.

    • Use fossil's repo wikis. Advantage: Easy to set up and easy to move around. Self-hosted. Editor seems a bit basic - e.g. inserting images is a bit awkward (to be fair, that seems to be the case for Github as well, to some degree).

    Anybody have experience with either of the above usage scenarios? Thoughts?

    Paying a few bucks for hosting is doable if there's a compelling reason to do so - the main risk of attempting to do so is that it may run into bureaucracy/IT, i.e., somebody may conclude that this is in IT's domain and thus require us to go via IT (which spells the end of that particular initiative).

    Edit: Wishlist includes: Being able to tag pages with a category and then list all pages of a certain category. Embedding code with syntax highlighting.


  • Discourse touched me in a no-no place

    @cvi said in Help Bites:

    Anybody have experience with either of the above usage scenarios? Thoughts?

    I've used a fossil wiki (but without putting internally-hosted images in; didn't need them for what I was doing) and it definitely works. I've not used Github wikis yet, despite having quite a few projects there; I've simply not had a use-case where they made sense.

    Other options to consider (and we do both of these):

    • A shared Google drive. They're easy to have a bunch of documents in, and you can cross-link quite easily. (We use this for our internal docs, and have done since before Office 365 was a thing so we're not about to change.)
    • A Github repo filled with markdown files. If you can fall off a log, you can write basic markdown. (We use this for our external docs.)

    In all the cases where I've actually done this, setting up shared access for a small group is pretty simple.



  • @cvi Heh. I once wrote a tiny wiki because I didn't like any of the options and thought it would be fun. Code is probably boring by front page standards, but not without :wtf:s (e.g. instead of a tag system, I wanted the wiki pages to form a tree structure, like files in directories, and implemented that on top of SQLite with the "path" as the primary key). Never got around to implementing image uploading.

    Use fossil's repo wikis.

    It's a nice option, especially together with rest of the repo, although nowadays, DRH seems to prefer Markdown files in the source tree for code documentation purposes: it's easier to have the same history for both the code and the docs this way. It's possible to have wiki pages referencing (and linked from) commits and branches, but no tags or categories. Additionally, Fossil speaks Pikchr now, which is a dialect of Kernighan's PIC with SVG output. There's at least one HOWTO at the Fossil forum regarding setting up syntax highlighting, but that's definitely non-trivial and may tie the wiki to a JavaScript+CSS CDN.


  • Notification Spam Recipient

    @aitap said in Help Bites:

    CDN

    Not necessarily....


  • ♿ (Parody)

    Has anyone successfully used the MS Teams Linux client?

    We just started using Teams "officially" at work and I want to get it running on my Kubuntu 20.04 VMWare guest. I downloaded the .deb file from MS and installed it but when I run it I get two blank windows. Based on size, one looks like the initial "Opening..." sort of dialog and the other is probably the login page. Also, the login one seems like it's modal because it won't let me interact with other windows until I close it from the task bar.

    Web client doesn't seem to want to work either.



  • @boomzilla said in Help Bites:

    Has anyone successfully used the MS Teams Linux client?

    Yeah. At the previous client, for a while I was using a laptop running Ubuntu (don't remember the version). I can't help much with your problems, though; for me it Just Worked™.


  • ♿ (Parody)

    @HardwareGeek my current (uninvestigated) suspicion is something to do with the graphics drivers that VMWare uses.



  • @boomzilla Sounds plausible. I was running it in the host OS, not a VM.



  • @boomzilla said in Help Bites:

    I downloaded the .deb file from MS and installed it but when I run it I get two blank windows.

    You'd think it would Just Work™ if you satisfied its declared dependencies...

    I've had to run it with --disable-namespace-sandbox --disable-setuid-sandbox --no-sandbox after the usual arguments. So the script goes exec .../teams "$@" --disable-namespace-sandbox --disable-setuid-sandbox --no-sandbox and then the desktop file goes Exec=.../teams.sh %U and MimeType=x-scheme-handler/msteams in order to make it join from the browser.

    (But I'm running it inside a firejail sandbox, so some shenanigans are to be expected.)

    It's known to produce very verbose logs in ~/.config/Microsoft/Microsoft Teams/logs.txt, maybe you'll find something there.


  • ♿ (Parody)

    @aitap yeah, the default script now does that stuff. I had found something online about that needing to be done.

    There are a few errors in the logs: can't find the installed / updated time, can't save env_config.json, errors loging configIds.

    :mlp_shrug:


  • ♿ (Parody)

    @aitap said in Help Bites:

    @boomzilla said in Help Bites:

    I downloaded the .deb file from MS and installed it but when I run it I get two blank windows.

    You'd think it would Just Work™ if you satisfied its declared dependencies...

    Tried it on my personal machine and...yup, works fine (same OS).

    Hmm...another difference (besides being a VMWare guest) is that on my work VM I use chromium, not chrome.



  • @dkf said in Help Bites:

    Other options to consider (and we do both of these):

    Maybe not a bad idea, will add it to the list. I'd probably rather go for the Github-repo than the Google drive, but that ultimately also depends on the others too. Makes editing/commenting a bit more awkward, but not too bad.



  • @aitap said in Help Bites:

    Additionally, Fossil speaks Pikchr now, which is a dialect of Kernighan's PIC with SVG output.

    Saw that. Looked somewhat neat for figures, albeit I'm guessing we're looking more at bitmap images in general. Sketching something quickly is probably more likely than actually drawing a diagram.



  • @boomzilla I'm using it. Well, only for video conferences. Because we still use Slack for chats. (Teams is a corporate overlord thing - but we're slowly moving some meetings from Zoom to Teams)

    edit: Should have mentioned, I'm using it on Ubuntu 18, natively.


  • ♿ (Parody)

    @dcon yeah, I mainly want this for chat, because we chat a lot on my team and it's kind of a pain to have to use the (already open) windows app when I'm working in my vm.


  • Notification Spam Recipient

    Disable GPU acceleration?



  • Anybody ever hear of Rivet Networks Killer Networking Software? Windows wants to reboot to update it, but I didn't install it and never heard of it until about 5 minutes ago. Apparently Intel acquired Rivet Networks last year, but I'm, shall we say, a wee bit leery of software I've never heard of being installed/updated automatically, and especially with no opt-out.



  • @HardwareGeek said in Help Bites:

    Anybody ever hear of Rivet Networks Killer Networking Software? Windows wants to reboot to update it, but I didn't install it and never heard of it until about 5 minutes ago. Apparently Intel acquired Rivet Networks last year, but I'm, shall we say, a wee bit leery of software I've never heard of being installed/updated automatically, and especially with no opt-out.

    I haven't heard of "Rivet", but I have heard of "Killer". I forget which machine ... <pause> ... Oh, this one. (opens properties) Oh looky. It says Rivet. Ok, I guess I have!

    a32260db-99cc-4fa4-abb0-32187d273454-image.png

    (there's also a Killer WiFi adapter in this machine)



  • @dcon said in Help Bites:

    there's also a Killer WiFi adapter in this machine

    Aha! I was thinking I was using an external WiFi dongle; I forgot it was built into the new machine. And it turns out it's a Killer. (The Ethernet controller is, too, but I don't have access to a wired network in my computer room.) I guess I'll let Windows update the driver, then (not that I had a choice); it's just a matter of scheduling a convenientslightly less inconvenient time for the reboot.


  • ♿ (Parody)

    @Tsaukpaetra said in Help Bites:

    Disable GPU acceleration?

    Hmm...I'll have to remember to try this next week.



  • @boomzilla said in Help Bites:

    Has anyone successfully used the MS Teams Linux client?

    We just started using Teams "officially" at work and I want to get it running on my Kubuntu 20.04 VMWare guest. I downloaded the .deb file from MS and installed it but when I run it I get two blank windows. Based on size, one looks like the initial "Opening..." sort of dialog and the other is probably the login page. Also, the login one seems like it's modal because it won't let me interact with other windows until I close it from the task bar.

    Web client doesn't seem to want to work either.

    Works fine for me. Though I only use audio through my phone. When sharing for work, I share with Teams on my work machine that is windows 10.

    ETA: When I did a Microsoft Hack, I used the screen sharing of Teams on my Ubuntu 20.04, since I did it from my machine. Microsoft guy said he was amused seeing Teams on Linux.



  • @aitap said in Help Bites:

    @boomzilla said in Help Bites:

    I downloaded the .deb file from MS and installed it but when I run it I get two blank windows.

    You'd think it would Just Work™ if you satisfied its declared dependencies...

    I've had to run it with --disable-namespace-sandbox --disable-setuid-sandbox --no-sandbox after the usual arguments. So the script goes exec .../teams "$@" --disable-namespace-sandbox --disable-setuid-sandbox --no-sandbox and then the desktop file goes Exec=.../teams.sh %U and MimeType=x-scheme-handler/msteams in order to make it join from the browser.

    (But I'm running it inside a firejail sandbox, so some shenanigans are to be expected.)

    It's known to produce very verbose logs in ~/.config/Microsoft/Microsoft Teams/logs.txt, maybe you'll find something there.

    That really looks like using a program under Linux. Microsoft has already achieved a great progress!



  • @BernieTheBernie said in Help Bites:

    That really looks like using a program under Linux.

    :topper: That's nothing compared to the pains that Skype is causing me. Leave it running for a seemingly random amount of time, and it stops interpreting key presses correctly and decides that Ctrl is k, Shift is m, t is post message and Ctrl+Q is start browser on the feedback page. Edit: it also always completely ignores the non-default keyboard layout.

    :trwtf: is me, of course, for running it in a custom sandbox on an otherwise outdated system, but the amount of breakage is impressive. How is that even possible? Isn't Skype just a copy of Chrome plus a bit of binary secret sauce nowadays?


  • And then the murders began.

    @aitap said in Help Bites:

    How is that even possible?

    🧙

    Isn't Skype just a copy of Chrome plus a bit of binary secret sauce nowadays?

    Skype for consumers is, Skype for Business isn't (last I checked, we've moved onto Teams since then).


  • ♿ (Parody)

    @Tsaukpaetra said in Help Bites:

    Disable GPU acceleration?

    🎉 That did it. Thanks!



  • Small question: Due to a recent event, I'd like to ask if there's some watchdog tool for Linux which I can tell to watch something like /var/log/whateverapp/errors.log for a certain entry to pop up (like /application foo has shat the bed/i) and if so, execute a small shell script? Preferrably with a debounce.



  • @Rhywden Alright, found this which should serve my intended purpose: https://mmonit.com/monit/documentation/monit.html#FILE-CONTENT-TEST


  • Banned

    @Rhywden tail -f piped to a hand-written program/script that reads stdin and runs the desired command in a loop.



  • I have a query from SQL Server that convert to JSON. I need that JSON in a text file. The final JSON looks very nice if it is short enough. But our use case will use far more rows than the output can handle.

    Doing this in SSIS, the overall JSON result is split over multiple rows. As a result, my text file that should be proper JSON has several carriage line/new line that I do not want.

    The majority of Microsoft documentation generally is for Azure. So it is difficult to find a solution for SSIS.

    I attempted a Script Component in a transformation to concatenate the text from each row, but adding the variable as output on the Component does not transfer the value. I just don't know how to properly set the output variable so that it is available in the step.

    If I could do a simple search and replace of the file, that would work. But I don't see a way to do that through SSIS either.

    Likely, I am not familiar with all of the possible transformation so I am missing any understanding of the object that I may need.

    I also have little experience with C#. Though I think if I figure out ow to make the output value move on to the next step, I can handle it.


  • Banned

    @Karla it's been a while since I did SSIS and it was only for one college class, but it does sound like the right tool. Script component sounds like an obvious solution, and it certainly can do output from variable, I just don't remember exactly how. And I'm not sure it can use the entire dataset at once - I only used it for per-row stuff.

    If script component doesn't work, then the file thing shouldn't be too bad. SSIS lets you output a data flow to file. There's also this second script component thing, not in the data flow view but in the main process view (or whatever it's called) that lets you run a script before/after other steps - you can use it to do the find/replace on the file automatically.



  • Xcode. Argh.

    I know I previously set xcode to be able to read environment variables (so I can add in CFLAGS $PACKAGE/include for instance). But, of course, I didn't document it (that I can find). And I'm failing my google-foo. I do have the variable set (via ~/Library/LaunchAgents/environment.plist, it uses launchctl) because I see them in bash.

    Am I missing something - or is xcode 13 and OSX12.0 just out to get me? (And this is definitely a :why_not_both:)

    (I'm trying to remember to document all the things I've done on the new machine so in the future I can repeat - considering I running at about 9yrs before replacing my Mac. Thank you Joplin...)



  • @Gąska said in Help Bites:

    @Karla it's been a while since I did SSIS and it was only for one college class, but it does sound like the right tool. Script component sounds like an obvious solution, and it certainly can do output from variable, I just don't remember exactly how. And I'm not sure it can use the entire dataset at once - I only used it for per-row stuff.

    If script component doesn't work, then the file thing shouldn't be too bad. SSIS lets you output a data flow to file. There's also this second script component thing, not in the data flow view but in the main process view (or whatever it's called) that lets you run a script before/after other steps - you can use it to do the find/replace on the file automatically.

    I solved the main problem or getting JSON into a file without line breaks by using a script task. Turned my query into a stored procedure.

    So instead of a data flow, I have it all in one script task. I've done very little scripting in SSIS as I don't know c# well.

    I had to create an ADO connection manager (rather than OLE db).

    I'm still going to have to make groups so I am not sending too much data at a time but at least I know as long as my data is within limits it will format properly.

    So I needed to figure out how to select every 25 (or whatever) rows into separate groups to make separate files.

    This was harder than I expected it to be. But I did figure it out. There may very well be a better way but I found one.

    Now I am significantly less stuck than I was yesterday.



  • @dcon said in Help Bites:

    Xcode. Argh.

    I know I previously set xcode to be able to read environment variables (so I can add in CFLAGS $PACKAGE/include for instance). But, of course, I didn't document it (that I can find). And I'm failing my google-foo. I do have the variable set (via ~/Library/LaunchAgents/environment.plist, it uses launchctl) because I see them in bash.

    Am I missing something - or is xcode 13 and OSX12.0 just out to get me? (And this is definitely a :why_not_both:)

    (I'm trying to remember to document all the things I've done on the new machine so in the future I can repeat - considering I running at about 9yrs before replacing my Mac. Thank you Joplin...)

    My google-foo is working today!

    defaults write com.apple.dt.Xcode UseSanitizedBuildSystemEnvironment -bool NO



  • @Gąska said in Help Bites:

    @Karla it's been a while since I did SSIS and it was only for one college class, but it does sound like the right tool. Script component sounds like an obvious solution, and it certainly can do output from variable, I just don't remember exactly how. And I'm not sure it can use the entire dataset at once - I only used it for per-row stuff.

    If script component doesn't work, then the file thing shouldn't be too bad. SSIS lets you output a data flow to file. There's also this second script component thing, not in the data flow view but in the main process view (or whatever it's called) that lets you run a script before/after other steps - you can use it to do the find/replace on the file automatically.

    What I ultimately did, use standard SSIS to create an cvs file, then use a destination from Kingswaysoft productivity pack that allows me to turn it to JSON.

    I had to make the JSON flatter, but it wasn't really necessary to be not flat (SQL Server lets you format it nicely--but if I can't import it into SSIS-it is useless). While there is still a limit to how many rows I can handle at a time, this does at least 500 rows. My other attempts using SQL Server's JSON capabilities all sucked.



  • Ok, probably simple SQL question. What's the best way to determine the following:

    Given two tables foo and bar, where each bar row has a foreign key to foo.id (many-to-one). I want to determine the average number of bars per foo. With minimal pain and minimal querying.


  • Java Dev

    @Benjamin-Hall try:

    SELECT COUNT(*)/COUNT(DISTINCT FOO.ID) FROM FOO LEFT JOIN BAR ON FOO.ID=BAR.FOO_ID;



  • @PleegWat said in Help Bites:

    @Benjamin-Hall try:

    SELECT COUNT(*)/COUNT(DISTINCT FOO.ID) FROM FOO LEFT JOIN BAR ON FOO.ID=BAR.FOO_ID;

    Thanks! I'm always unsure about the DISTINCT thing...



  • @Benjamin-Hall I think count(distinct x) doesn't always work in all SQL dialects. Something with group by foo.id would be safer/more reliable, but :kneeling_warthog: to figure out the whole thing



  • @hungrier said in Help Bites:

    @Benjamin-Hall I think count(distinct x) doesn't always work in all SQL dialects. Something with group by foo.id would be safer/more reliable, but :kneeling_warthog: to figure out the whole thing

    Working for these ad-hoc queries (just trawling through the read only database looking for patterns in some things).



  • @Benjamin-Hall If you only need to do it once, go ahead and use whatever to get your answer. But for something that'll live permanently in your project it would be more maintainable to Do It Right™



  • @hungrier said in Help Bites:

    @Benjamin-Hall If you only need to do it once, go ahead and use whatever to get your answer. But for something that'll live permanently in your project it would be more maintainable to Do It Right™

    Yeah. Thankfully I'm just fishing for data, so convenience outweighs doing it proper.


  • Java Dev

    @hungrier said in Help Bites:

    @Benjamin-Hall I think count(distinct x) doesn't always work in all SQL dialects. Something with group by foo.id would be safer/more reliable, but :kneeling_warthog: to figure out the whole thing

    AVG(SUM(1)) ... GROUP BY X, I think. Or a nested query; not all engines like nesting aggregating functions like that either.



  • Hi all, having a problem with T-SQL truncating some text that I am building up. I'm not really even sure which line it is happening on, but I have some clues.

    I can't post the text I am building, but I was given a couple of pages of plain text to prepend to a database field. The database field is set to be a varchar(max). In the specific case I am working on, the database is already strong somewhat "long" text (another couple of pages), but it's not anything crazy like 2GB.

    Because T-SQL is somewhat braindead about strings that contain new lines, I am building up the prepend string by appending paragraphs together, with appropriate newlines between them (i.e., char(13) + char(10)).

    Then, I am applying an update of the form:

    update dbo.Narrative
       set TX_NARRATIVE = concat( isnull(@PrependText,'')
                                , TX_NARRATIVE
                                , isnull(@PostpendText, '') 
                                )
    where ...
    

    but I am getting an error:

    8152: String or binary data would be truncated.

    Any ideas? I have switched between + and concat, did some googling and found suggestions to cast things to varchar(max), etc. But I am stuck now.


  • And then the murders began.

    @Captain said in Help Bites:

    I can't post the text I am building, but I was given a couple of pages of plain text to prepend to a database field. The database field is set to be a varchar(max). In the specific case I am working on, the database is already strong somewhat "long" text (another couple of pages), but it's not anything crazy like 2GB.

    Does the Narrative table have a trigger (e.g. for logging)? It might not be the TX_NARRATIVE field that's the problem, but rather some other table being updated by the trigger.


Log in to reply