941Local SSH Key via ssh-add
- Add SSH to the Git Service
- Run
ssh-add
locally - Connect via
ssh
to your server
ssh-add
ssh user@host
git status
git ...
Check status of ssh-add
ssh-add -l
Delete all keys from current process
ssh-add -D
ssh-add
locallyssh
to your serverssh-add
ssh user@host
git status
git ...
Check status of ssh-add
ssh-add -l
Delete all keys from current process
ssh-add -D
In .htaccess:
<Files myfile.php>
AuthType Basic
AuthName "Authentication Required"
AuthUserFile /path/to/.htpasswd
Require valid-user
</Files>
As of 2019, the minimum window width for both Chrome and Safari browser windows is 500px. Which is might annoying, if your are developing a site with breakpoint at less than 500px.
window.open(
'https://codec.trembl.org/939',
'myDevWindow',
'width=400,height=400,resizable,scrollbars=yes,status=yes'
)
Example:
Observations:
In Chrome, the window becomes fully resizable, up to a 188 x 113px - which seems to be the absolute minimal window size.
In Safari, the window becomes resizable up to the specified size, the minimum size being 100px wide and 77px high.
htpasswd -nb username password
Using just -n username will prompt twice for the password.
htpasswd -n username
From htpasswd man:
-n Don't update file; display results on stdout.
-b Use the password from the command line rather than prompting for it.
awk 'NR % 2 == 1' // every 2nd line
awk 'NR % 10 == 1' // every 10th line
awk 'NR % 100 == 1' // every 100th line
NR ordinal number of the current record
N == 1 keeps the first line intact, whereas N == 0 would remove the first line. Important for CSV files.
tar -vcf target.tar source
v → verbose
c → create
f → file. word followed by f will be name of archive, f needs to be last in the command.
ssh -i ~/.ssh/path_to_key username@server
A site that was developed some years ago with Wordpress 4.x and ACF 4.x got moved to a new server. During the migration process, Wordpress and the Plug-ins were updated to their latest version - I assume, before the MySQL DB got migrated, which let to the following complaint:
After some detective work, I realise that the data was still present. ACF v4.x was storing the ACF data in wp_options, ACF v5.x is storing it in wp_termmeta.
Which is great, because all that is needed, is to update the DB! But how to do it?
Didn't work as expected.
In the wp_options, the acf_version is set to the current WP version, 5.7.6 in this case. Setting it to 4.4.12, triggered the ACF DB update script, the ACF data got migrated to wp_termmeta, the site is working again as expected.
Shout out to the ACF Support Pages for solving the last piece of the puzzle.
301 Redirect is great, if you want to keep you old structure and only change the server.
.htaccess
Redirect 301 / https://www.trembl.org/
Any page of your old.site/about would get redirected to https://www.trembl.org/about.
If you want to redirect all your page links from your old.site (e.g. old.site, old.site/aaa, old.site/bbb, ...) to https://www.trembl.org, use this RewriteRule:<
.htaccess
RewriteEngine On
RewriteRule ^(.*)$ https://www.trembl.org/ [R=301]
Set Levels by Value
x$name <- factor(x$name, levels = x$name[order(x$val)])
Set Levels by Name, Reverse Name Vector, first Name on top
df$name <- factor(df$name, levels = rev(df$name))
TODO:
Source: https://rstudio-pubs-static.s3.amazonaws.com/7433_4537ea5073dc4162950abb715f513469.html