Skip to content

Instantly share code, notes, and snippets.

View t0b1hh's full-sized avatar
💭
I may be slow to respond.

Tobi G. t0b1hh

💭
I may be slow to respond.
  • Hamburg
View GitHub Profile
@t0b1hh
t0b1hh / wpml_403.md
Last active September 21, 2023 12:36
WPML API returning error 403 because of missing user agent

If the registration API of the wordpress plugin WPML / OTGS returns an error 403 or "invalid response" try to add an user-agent header to the api call.

wp_remote_post() seems to send w/o user-agent - perhaps depending on your installation/server-config.

Add this php snippet to your functions.php or some custom plugin:

function my_http_request_args($args) {
  $args['user-agent'] = 'WordPress';
 return $args;
@t0b1hh
t0b1hh / README.md
Created August 24, 2021 15:47 — forked from deviantony/README.md
Portainer admin password in a docker-compose environment

Portainer compose deployment with admin password preset

This file aims to explain how to deploy Portainer inside a compose file with the admin password already set.

Generate the admin password

For this example, we'll use the password superpassword.

Use the following command to generate a hash for the password:

@t0b1hh
t0b1hh / homebrew old version.txt
Created March 24, 2021 22:21 — forked from sawant/homebrew old version.txt
Install older version of Formula in Homebrew
[From: http://hanxue-it.blogspot.com/2018/08/macos-homebrew-installing-older-version-of-software.html - just created a copy to keep it for long term]
Homebrew always wants to install the latest version of the Formula (software). This is by design, because every time there is an update to a formula, it wants to be tested against all the other formulas that it depends on. Mixing new and old versions of software is a recipe for incompatibility disaster.
But sometimes there are situations where you need an older version of software. In my specific case, Yarn was compiled against an older version of icu4c, and I want that older version instead of recompiling Yarn.
$ yarn install
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/node
@t0b1hh
t0b1hh / bash .profile simple color schemes
Last active September 2, 2023 19:38
color bash via .profile (ok and some aliases)
#!/bin/bash
alias ls='ls --color=auto'
alias l='ls -al'
alias ..='cd ..'
## colored path
PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] '
@t0b1hh
t0b1hh / multiple_ssh_setting.md
Created March 12, 2021 19:36 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"