I've setup Apache with suEXEC, fcgid and userdir to enhance overall website security.
Everything works expect for useraccounts with a "." between their accountnames. Before using suEXEC and fcgid, this used to work although that practice has been discouraged many years ago.
For example: mydomain.com/~mytest/ works
mydomain.com/~my.test/ doesn't work
The error message that I get is "Bad Request Your browser sent a request that this server could not understand."
Is there a quick workaround to this or I'm I doomed at recreating all the accounts without any accountname separation?
Historically usernames were up to 8 characters long, started with a letter, and contained only lower case letters, underscore, and numbers. Some systems still make this assumption, and that is probably what is catching you out here.
Related
I'm using two approaches to backing up a database file, rsync and a server-based API approach.
I'm getting slightly different results because of some particular certain high-numbered unicode characters, so the two backups are just a little bit different.
The characters in question are, in one case ⸭ (a unicode 2E2D), 猄 (unicode 7304), 璣 (74a3) which makes the voyage just fine through rsync, but which all become �� (two unicode FFFD characters) using the server / API approach.
Interestingly not all higher-numbered unicode characters get transformed to FFFDs. A 䋲 (42F2), a 0698, and thousands of others that are not converted and make it through just fine.
In fact there are only about 7 characters in the entire file that get transformed in transit.
I'm trying to get this to the point where there no difference whatsoever.
Basically there's an occasional discrepancy handling high-numbered unicode.
In both cases the backup files created are utf8 with char(10) line feeds.
Here's the basic difference between the two backup approaches:
RSYNC APPROACH
rsync -avuP path/to/server/ActiveDb.sql path/to/Backup.sql
SERVER APPROACH
ThisStream=Fs.createReadStream("/path/to/ActiveDb.sql");
ThisStream.on("open", ()=>{
ThisStream.pipe(Rr.Res);
});
On the backup machine
spawn=require("child_process").spawn("curl", ["-d", "apicall=bkup", "https://dbserver.server"]);
spawn.stdout.on("data", thisChunk=>{
Fs.appendFileSync("path/to/Backup.sql", thisChunk);
});```
When configuring realm in ADFS, should it be "Urn" or "urn". I know the format is urn:anything:anything. I'm more concerned about the urn.
Will it work if it starts with uppercase and not lowercase?
Does it matter as long as the same thing is configured on both SharePoint and ADFS?
No - I normally use lower case but should work as long as both match.
Has anyone noticed that the service started sending the image's URL with an extra backslash before every slash?
e.g.:
"icon": "https:\ /\ /foursquare.com\ /img\ /categories\ /food\ /default.png".
instead of:
https://foursquare.com/img/categories/food/default.png
Is this normal? Thanks in advance.
We (foursquare) made the change yesterday to the way we serialize JSON output, but should have done so in a way that won't break any modestly mature JSON handler. We may tweak how we do serialization in the future (always in compliance with the JSON spec) and we recommend you build your system to be robust against future changes.
I'm working on supporting of the TCL (thermal control protocol, stupid name, its a printer protocol of futurelogic) but i cannot find resources about this protocol, how it is, how it works, nothing, on theirs site i only found this mention http://www.futurelogic-inc.com/trademarks.aspx
any one had worked with it? does any one knows where can i find the data sheet?
The protocol is documented on their website http://www.futurelogic-inc.com/support/downloads/
If you are targetting the PSA66ST model it supports a number of protocols TCL, which is quite nice for delivering templated tickets and, line printing using the Epson ESC/P protocol.
This is all explained in the protocol document.
Oops, these links are incorrect and only correspond to marketing brochures. You will need to contact Futurelogic for the protocol documents. Probably also need to sign an NDA. Anyway, the information may guide you some more.
From what I can gather, it seems the FutureLogic thermal printers do not support general printing, but only printing using predefined templates stored in the printer's firmware. The basic command structure is a caret ^ followed by a one or two character command code, with arguments delimited using a pipe |, and the command ended with another caret ^. I've been able to reverse-engineer a few commands:
^S^ - Printer status
^Se^ - Extended printer status
^C|x|^ - Clear. Known arguments:
a - all
j - jam
^P|x|y0|...|yn|^ - Print fields y0 through yn using template x.
Data areas are defined in the firmware using a similar command format, command ^D|x|y0|...|yn|^, and templates are defined from data areas using command ^T|z|x0|...|xn|^.
I tried everything possible, but still failed. I thought I got it at the point which I'll post
as my final attempt, but still isn't good [enough].
A script is being passed three arguments. Domain name, username and password.
But the probles is that I need domain separated in "domain" + ".com" format. Two variables.
I tried to split it using name.extension cheat, but it doesn't work quite well.
Check the simple code:
#echo off
echo.
set domain=%~n1
set ext=%~x1
echo %DOMAIN%
echo %EXT%
echo.
When you try it, you get:
D:\Scripts\test>test.bat domain.com
domain
.com
D:\Scripts\test>test.bat domain.co.uk
domain.co
.uk
First obviously does work, but only because I'm able to cheat my way through.
String operations in DOS Shell are a pain in the ass. I might be able to convince
a script writer to pass me 4 arguments instead of 3... but in case that fails... HELP!
Windows ships with the Windows Scripting Host which lets you run javascript.
Change the batch file to:
#echo off
cscript //Nologo test.js %*
Create test.js:
if (WScript.Arguments.Length > 0) {
var arg = WScript.Arguments.Item(0);
var index = arg.indexOf('.');
if (index != -1) {
var domain = arg.substring(0, index);
var ext = arg.substring(index);
WScript.Echo(domain);
WScript.Echo(ext);
} else WScript.Echo("Error: Argument has no dots: " + arg);
} else WScript.Echo("Error: No argument given");
And you can use it:
C:\Documents and Settings\Waqas\Desktop>test.bat domain.com
domain
.com
C:\Documents and Settings\Waqas\Desktop>test.bat domain.co.uk
domain
.co.uk
And that does what I think you wanted.
If you want to automatize something (as stated in another answer), my solution would be to use appropriate tools. Install a Perl runtime or something else you're comfortable with. Or use the Windows power shell
Also, unless you supply your script with a list of valid top level domains, there is NO WAY, in no language, that your script can decide whether test.co.uk should be splitted as text and co.uk or test.co and uk. The only feasible possibility would be to make sure that you get only second-level-domains without sub-domain parts. Simply split at the first dot in that case.
BTW: I'm curious to why you would want to automate website creation in a Windows shell script. You aren't doing anything nasty, are you?