After logging in, I tried to run Terraform in GCP and received this error:
oauth2: cannot fetch token: 400 Bad Request |
Here’s the fix. Login using application-default.
gcloud auth application-default login |
You can then Terraform.
terraform apply |
cloud engineer
by Ulysses ·
After logging in, I tried to run Terraform in GCP and received this error:
oauth2: cannot fetch token: 400 Bad Request |
oauth2: cannot fetch token: 400 Bad Request
Here’s the fix. Login using application-default.
gcloud auth application-default login |
gcloud auth application-default login
You can then Terraform.
terraform apply |
terraform apply
by Ulysses ·
SCP is similar to the CP or copy command, but it’s done via a secure network.
Here’s a CP command.
cp /dir1/filename /dir2 |
cp /dir1/filename /dir2
You can use SCP to copy file to another system. It requires login.
scp /dir1/filename user@server:/home/user |
scp /dir1/filename user@server:/home/user
This is using SCP to copy a file from 2 remote systems.
scp user@host1:/home/user/dir1/file.txt user@host2:/home/user/dir2 |
scp user@host1:/home/user/dir1/file.txt user@host2:/home/user/dir2
by Ulysses ·
Here’s how to login to GCP from Google SDK.
gcloud auth login |
gcloud auth login
You will then be taken to a page that you have successfully logged in.
by Ulysses ·
.bash_profile is executed for login shells. .bashrc is executed for interactive non-login shells. When you login, .bash_profile is executed. If you are already logged in, .bashrc is executed. .bashrc is also executed when you start a new bash using /bin/bash.
by Ulysses ·
How to login using SFTP on a non-standard port.
sftp -oPort=2233 username@servername |
sftp -oPort=2233 username@servername
Get list of commands.
sftp help |
sftp help
by Ulysses ·
Lastlog displays the latest login information of all users in the system. You can’t view the lastlog file since it’s not an ascii file. You’ll need to run the actual command to view what’s in it. The program will spit out a list that may be longer than your terminal buffer. In that case, it’s best to pipe the output to “more” or better yet, use the “grep” command to isolate the user.
lastlog | more lastlog | grep johndoe |
lastlog | more lastlog | grep johndoe
by Ulysses ·
We’ve all seen the default WordPress login page. It’s dull, bland, and boring. Typically, the login page is not part of the WordPress theme setup. Most theme designers don’t bother to change the login screen because it’s not really necessary. The cool thing is, it’s entirely feasible to customize the login page. This article will show you how to change your WordPress login page to something like below.
We can replace the WordPress logo located on top of the login form by calling a WordPress hook called ‘login_enqueue_scripts.’ This hook is responsible for enqueuing items to the login page. In this example, we are assigning an image to ‘body.login div#login h1 a.’
Place the following code in your theme’s ‘functions.php’ file.
function urr_login_logo() { } |
function urr_login_logo() { }
The ‘logo.png’ file is located in your theme’s ‘images’ folder. Why can’t I see the logo image? Believe me, it’s there. You can’t see it because I made it transparent. It would be visible if it were non-transparent. So, it’s possible to replace the WordPress logo or display nothing at all, like I just did just now, using a transparent image.
By the way, the image needs to be 80×80 pixels in size.
How do we add a background image to the login page? Well, one thing worth noting, WordPress does not load your theme’s stylesheet when the login page is loaded. To style to the login page, we need to add our own custom stylesheet. It will be loaded when the login page is displayed.
Now, place the following code in your theme’s ‘functions.php’ file.
function urr_custom_login_css() { echo ''; } add_action('login_head', 'urr_custom_login_css'); |
function urr_custom_login_css() { echo ''; } add_action('login_head', 'urr_custom_login_css');
This code above loads a stylesheet when the login page is loaded. It’s using the ‘login_head’ hook.
Create a file called login-style.css and place it inside our theme’s directory under the ‘css’ folder. We can now style our login page. The code below will apply a background image ‘darkwood.jpg’ to the login page. The form and its inputs are darkened, except for the submit button which remains unchanged. In addition, we also rounded the corners of the form.
body.login { background: #000 url('http://uly.me/wp-content/themes/minimum/images/darkwood.jpg') no-repeat fixed center; } div#login form { background-color:#111; border-radius: 10px; } div#login form input#user_pass, div#login form input#user_login, div#login form input#rememberme { color: #aaa; background-color:#333; border: 1px solid #000; border-radius: 3px; } div#login form input#user_pass, div#login form input#user_login, div#login form input#rememberme { color: #aaa; background-color:#333; } |
body.login { background: #000 url('http://uly.me/wp-content/themes/minimum/images/darkwood.jpg') no-repeat fixed center; } div#login form { background-color:#111; border-radius: 10px; } div#login form input#user_pass, div#login form input#user_login, div#login form input#rememberme { color: #aaa; background-color:#333; border: 1px solid #000; border-radius: 3px; } div#login form input#user_pass, div#login form input#user_login, div#login form input#rememberme { color: #aaa; background-color:#333; }
Finally, upload your functions.php, login-styles.css and images files to your server. Enjoy your custom login page.