Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 days ago.
Improve this question
I have a problem with the asicii image, I'm making a terminal with html css and javascript, I'm doing it like this
enter image description here
code :
case "docker":
result = `
## .
## ## ## ==
## ## ## ## ===
/""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\______/
| |
__ | __ __ | _ __ _
/ \| / \ / |/ / _\ |
\__/| \__/ \__ |\_ \__ |
`;
I waited for the complete image and it got back to me online
Related
I am writing firebase security rules, and I am attempting to get a document that may have a space in its documentID.
I have the following snippet which works well when the document does not have a space
function isAdminOfCompany(companyName) {
let company = get(/databases/$(database)/documents/Companies/$(companyName));
return company.data.authorizedUsers[request.auth.uid].access == "ADMIN;
}
Under the collection, "Companies", I have a document called "Test" and another called "Test Company" - Trying to get the document corresponding to "Test" works just fine, but "Test Company" does not seem to work, as the company variable (first line into the function) is equal to null as per the firebase security rules "playground".
My thought is that there is something to do with URL encoding, but replacing the space in a documentID to "%20" or a "+" does not change the result. Perhaps spaces are illegal characters for documentIDs (https://cloud.google.com/firestore/docs/best-practices lists a few best practices)
Any help would be appreciated!
EDIT: As per a few comments, I Will add some additional images/explanations below.
Here is the structure of my database
And here is what fields are present in the user documents
In short, the following snippet reproduces the problem (I am not actually using this, but it demonstrates the issue the same way)
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /Users/{user} {
allow update: if findPermission(resource.data.company) == "MASTER"
}
function findPermission(companyName) {
let c = get(path("/databases/" + database + "/documents/Companies/" + companyName));
return c.data.authorizedUsers[request.auth.uid].access;
}
}
}
When I try to update a user called test#email.com (which belongs to company "Test"), the operation is permitted, and everything works exactly as expected.
The issue arises when a user, called test2#email.com, who belongs to company "Test Company" comes along and makes the same request (with authorization email/uid updated in playground, to match what is actually found in the company structure), the request fails. The request fails, since the get() call (line 1 of the function) cannot find the Company document corresponding to "Test Company" - indicated by the variable "c" being null in the screenshot (see below) - IT IS NOT NULL WHEN LOOKING FOR "Test"
Below is a screenshot of the error message, as well as some of the relevant variables when the error occurs
Check to see what type of space just in case it is another non-printable character. You could convert it to Unicode, and check what it might be. However, it is considered bad practice to use spaces in naming variables and data structures. There are so many different types to consider.
| Unicode | HTML | Description | Example |
|---------|--------|--------------------|---------|
| U+0020 |   | Space | [ ] |
| U+00A0 |   | No-Break Space | [ ] |
| U+2000 |   | En Quad | [ ] |
| U+2001 |   | Em Quad | [ ] |
| U+2002 |   | En Space | [ ] |
| U+2003 |   | Em Space | [ ] |
| U+2004 |   | Three-Per-Em Space | [ ] |
| U+2005 |   | Four-Per-Em Space | [ ] |
| U+2006 |   | Six-Per-Em Space | [ ] |
| U+2007 |   | Figure Space | [ ] |
| U+2008 |   | Punctuation Space | [ ] |
| U+2009 |   | Thin Space | [ ] |
| U+200A |   | Hair Space | [ ] |
I'm trying to start grakn but it fails :
grakn server start
====================================================================================================
________ _____ _______ __ __ __ __ _______ _______ _____ _______
| __ || _ \ | _ || | / /| \ | | | _ || _ || _ \ | ____|
| | |__|| | | | | | | || | / / | \ | | | | |__|| | | || | | | | |
| | ____ | |_| / | |_| || |/ / | \| | | | | | | || |_| / | |____
| ||_ || _ \ | _ || _ \ | _ | | | __ | | | || _ \ | ____|
| |__| || | \ \ | | | || | \ \ | | \ | | |_| || |_| || | \ \ | |____
|________||__| \__\|__| |__||__| \__\|__| \__| |_______||_______||__| \__\|_______|
THE KNOWLEDGE GRAPH
====================================================================================================
Version: 1.8.3
Starting Storage....FAILED!
Unable to start Storage.
Process exited with code '1': 'Unrecognized VM option 'CrashOnOutOfMemoryError'
Did you mean 'OnOutOfMemoryError=<value>'?
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
'
An error has occurred during boot-up. Please run 'grakn server status' or check the logs located under the 'logs' directory.
Process exited with code '1': 'Unrecognized VM option 'CrashOnOutOfMemoryError'
Did you mean 'OnOutOfMemoryError=<value>'?
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
'
The most likely cause of this error is that you have an incompatible Java version installed.
You can check the Java version by running java -version in a terminal window.
Grakn 1.8 requires at least version 1.8.0_92 of Java to run.
See also https://github.com/graknlabs/grakn/issues/5267 for more discussion on this topic.
I have the following, incomplete Julia code:
mutable struct Env
end
function step(env, action:UInt32)
return ones(8), 1.0, true, Dict()
end
function reset(env)
return ones(8)
end
When I try to use it, I get the following errors:
LoadError: error in method definition: function Base.step must be
explicitly imported to be extended
LoadError: error in method definition: function Base.reset must be
explicitly imported to be extended
I don't know what Base.step and Base.reset are, and I don't want to extend them.
Is there some way for me to keep these function names without extending the base functions? If I do just extend the base functions with my completely unrelated methods, are there going to be problems?
I really do not want to change the names of my functions because I want to keep them in line with the OpenAI Gym API.
Define them inside a module like this
module Gym
mutable struct Env
end
function step(env, action::UInt32)
return ones(8), 1.0, true, Dict()
end
function reset(env)
return ones(8)
end
end
Then you can call them directly as step and reset inside the module. Outside the module you have to qualify them like this: Gym.step and Gym.reset.
Additionally - note that you get this problem only after you introduce step and reset in Main module before trying to extend them (e.g. by calling or referencing them). So when starting a clean Julia session this will work:
$ julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.0.2 (2018-11-08)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> step(x) = x
step (generic function with 1 method)
but this will fail:
$ julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.0.2 (2018-11-08)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> step
step (generic function with 4 methods)
julia> step(x) = x
ERROR: error in method definition: function Base.step must be explicitly imported to be extended
When I try to create a new Angular Cli project:
receive this message (in Run window) after a few seconds after executing ng new angularcli --dir=. command by IDE:
"C:\Program Files\nodejs\node.exe" C:\Users\I\AppData\Roaming\npm\node_modules\#angular\cli\bin\ng new angularcli --dir=.
Error: Schematic input does not validate against the Schema: {"directory":".","name":"angularcli","skipGit":false,"style":"css","version":"1.7.3","commit":{"message":"chore: initial commit from #angular/cli\n\n _ _ ____ _ ___\n / \\ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|\n / △ \\ | '_ \\ / _\\` | | | | |/ _\\` | '__| | | | | | |\n / ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | |\n/_/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\n |___/\n","name":"Angular CLI","email":"angular-cli#angular.io"},"path":"app","sourceDir":"src","inlineStyle":false,"inlineTemplate":false,"routing":false,"prefix":"app","skipTests":false,"skipInstall":false,"linkCli":false,"minimal":false,"serviceWorker":false}
Errors:
.directory should match format "path"
Schematic input does not validate against the Schema: {"directory":".","name":"angularcli","skipGit":false,"style":"css","version":"1.7.3","commit":{"message":"chore: initial commit from #angular/cli\n\n _ _ ____ _ ___\n / \\ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|\n / △ \\ | '_ \\ / _\\` | | | | |/ _\\` | '__| | | | | | |\n / ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | |\n/_/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\n |___/\n","name":"Angular CLI","email":"angular-cli#angular.io"},"path":"app","sourceDir":"src","inlineStyle":false,"inlineTemplate":false,"routing":false,"prefix":"app","skipTests":false,"skipInstall":false,"linkCli":false,"minimal":false,"serviceWorker":false}
Errors:
.directory should match format "path"
Done
Similarly on Mac:
It seems to be relevant to this part of the command: --dir=.. But I don't know why and how to correct it!
(I know that I can create a new project via command line independently and then open it in WebStorm, but don't want this for some reasons.)
it's a known cli 1.7.x issue - https://github.com/angular/angular-cli/issues/9655; unfortunately we have been unable to fix it on our end so far... We are working with Angular team on this, please follow WEB-31291 for updates.
As a workaround, you can try creating new angular app in terminal using ng new <project_name> and then opening the generated project folder in WebStorm
Do not include project name special characters. for example this is wrong: www_testProject.
This is correct: wwwTestProject
I have this issue, But I got a solution which is works for me is:
New project names must start with a letter, and must contain only alphanumeric characters or dashes. When adding a dash the segment after the dash must also start with a letter.
Invalid- new_something
Valid- new-something
According to my last test, there is no problem. I upgraded my tools (Angular CLI v7.1.4 and WebStorm v2018.3.2):
I have an endpoint URL that needs to be hit daily to execute an API call. It requires login. I can't seem to get a cURL or wget command that will successfully log in. I've tried this cURL command:
/usr/bin/curl -L --silent --data
"log=login&pwd=password&ag_login_accept=1&ag_type=login"
https://www.the-url.com 2>&1 | /usr/bin/mail -s "subject"
email#domain.com
but the output is html of the login page, not the api output I get if I manually log in and then go to the url.
I also tried wget:
wget --save-cookies ~/sites/scripts/cookies.txt --keep-session-cookies
--post-data="log=login&pwd=password&ag_login_accept=1&ag_type=login" \
"https://www.the-url.com"
with the same result.
I do this sort of thing:
#!/bin/bash
WPUSR=user_name_goes_here
WPPWD=password_goes_here
COOKIEFILE=`mktemp`
COPT="--load-cookies $COOKIEFILE --save-cookies $COOKIEFILE --keep-session-cookies"
WGET="wget -nv -q ${COPT}"
MSG=`which banner || which figlet || which echo`
function printout() {
links -dump ${1} | grep -v "^ *$" | grep -A 10 "Skip to content"
}
function message() {
$MSG "$1"
}
# login
message 'Login'
LOGIN="log=${WPUSR}${LOGIN}&pwd=${WPPWD}"
LOGIN="${LOGIN}&redirect_to=http://127.0.0.1/wp/?p=1"
${WGET} -O page_01.html --post-data="${LOGIN}" 'http://127.0.0.1/wp/wp-login.php'
printout page_01.html
# show post
message 'View Post'
${WGET} -O page_02.html 'http://127.0.0.1/wp/?p=2'
printout page_02.html
rm "${COOKIEFILE}"
output:
| | ___ __ _(_)_ __
| | / _ \ / _` | | '_ \
| |__| (_) | (_| | | | | |
|_____\___/ \__, |_|_| |_|
|___/
Skip to content
Sitename
Sitename
Just another WordPress site
Posted on 2018-04-11 by jmullee
Hello world!
Welcome to WordPress. This is your first post. Edit or delete it, then
start writing!
One Reply to “Hello world!”
1. A WordPress Commenter says:
2018-04-11 at 16:05
__ ___ ____ _
\ \ / (_) _____ __ | _ \ ___ ___| |_
\ \ / /| |/ _ \ \ /\ / / | |_) / _ \/ __| __|
\ V / | | __/\ V V / | __/ (_) \__ \ |_
\_/ |_|\___| \_/\_/ |_| \___/|___/\__|
Skip to content
Sitename
Sitename
Just another WordPress site
Sample Page
This is an example page. It’s different from a blog post because it will
stay in one place and will show up in your site navigation (in most
themes). Most people start with an About page that introduces them to
potential site visitors. It might say something like this:
Hi there! I’m a bike messenger by day, aspiring actor by night, and this
is my website. I live in Los Angeles, have a great dog named Jack, and I
Alternative suggestion, connect to ssh from a php bash script:
Additional php package needed: php-ssh2
sudo apt install php-ssh2
#!/usr/bin/php
<?php
$connect = ssh2_connect('20.32.66.66.xx', 22);
ssh2_auth_password($connect, 'root', 'PtrDHfutyxxx');
$shell = ssh2_shell($connect, 'xterm');
$stream = ssh2_exec($connect, 'ls -a'); // Example command execute ls
stream_set_blocking($stream, true);
$stream_out = ssh2_fetch_stream($stream, SSH2_STREAM_STDIO);
echo stream_get_contents($stream_out); // Output command result
// ...
It is a base, fine to use from the shell over a vpn.
To avoid passwords in scripts, and secure it one level up, use crypto key pairs for logging.
http://php.net/manual/en/function.ssh2-publickey-init.php