Skip to content

Instantly share code, notes, and snippets.

View runlevel5's full-sized avatar

Trung Lê runlevel5

View GitHub Profile

How to change GNOME background settings:

use dconf-editor or gsettings to change following properties:

  • org.gnome.desktop.background.picture-uri file:///home/tle/Pictures/pattern4.png
  • org.gnome.desktop.background.picture-options 'wallpaper'
  • org.gnome.desktop.background.primary-color #3c6eb4
  • org.gnome.desktop.background.secondary-color #294172

How to create wallpaper profile?

Debian buster ppc64el

portable libyaml

cd /tmp
wget https://github.com/yaml/libyaml/archive/dist-0.2.2.tar.gz
tar xzvf dist-0.2.2.tar.gz
cd libyaml-dist-0.2.2
mkdir -p $HOME/.linuxbrew/Homebrew/Cellar/portable-libyaml/0.2.2
./configure --enable-static --disable-shared --disable-dependency-tracking --prefix=$HOME/.linuxbrew/Homebrew/Cellar/portable-libyaml/0.2.2
@runlevel5
runlevel5 / gl_vk_chopper_build_fedora32_ppc64le.log
Last active February 22, 2020 13:01
A full snippet on how to build gl_vk_chopper with Fedora 32 (ppc64le)
$ cat /etc/os-release
NAME=Fedora
VERSION="31 (Server Edition)"
ID=fedora
VERSION_ID=31
VERSION_CODENAME=""
PLATFORM_ID="platform:f31"
PRETTY_NAME="Fedora 31 (Server Edition)"
ANSI_COLOR="0;34"
LOGO=fedora-logo-icon

ERROR LOG

Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/tle/src/devilutionX/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_ce964/fast && /usr/bin/gmake -f CMakeFiles/cmTC_ce964.dir/build.make CMakeFiles/cmTC_ce964.dir/build
gmake[1]: Entering directory '/home/tle/src/devilutionX/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_ce964.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_ce964.dir/src.c.o -c /home/tle/src/devilutionX/build/CMakeFiles/CMakeTmp/src.c
@runlevel5
runlevel5 / elasticsearch7.md
Last active November 12, 2019 11:48
Elasticsearch 7 cheat sheet

How to combine many queries together in query? Simply use bool boolean with must

{
  "query: {
    "bool": {
      "must": [
        { <query 1> },
        { <query 2> }
 ]
@runlevel5
runlevel5 / nginx_njs_environment_variables.md
Last active February 28, 2024 09:17
Using njs to fetch environment variables

There are many ways to parse in variable into the nginx config file. Some uses set_by_lua which is offered by lua-nginx-module. Some use envstubst to populate varilabes into a template file.

Today I am going to show you how to do that with njs the JS scripting engine for nginx.

## /etc/nginx/fetch_env.js
function fetch_upstream_host(r) {
 return process.env.UPSTREAM_HOST;
@runlevel5
runlevel5 / how_to_install_mysql2_with_bundler.md
Last active July 3, 2019 06:11
How to bundler to bundle install mysql2 gem

So if you have ever run into failing to install mysql2 gem with bundler, here is a quick way to resolve it:

  1. Install MySQL with dev headers
  2. Configure bundler mysql2.build option: bundle config build.mysql2 --with-mysql-dir=<path_to_mysql_folder>
  3. bundle install

If you run into issue like this (which is likely if your MySQL does not get installed into /usr/local/mysql on macOS)

/Users/tle/.asdf/installs/ruby/2.3.5/lib/ruby/gems/2.3.0/gems/mysql2-0.5.2/lib/mysql2.rb:33:in `require':LoadError: dlopen(/Users/tle/.asdf/installs/ruby/2.3.5/lib/ruby/gems/2.3.0/gems/mysql2-0.5.2/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/mysql/lib/libmysqlclient.20.dylib
@runlevel5
runlevel5 / codedeploy.md
Last active February 22, 2019 03:53
Where does AWS CodeDeploy agent store its scripts?

/opt/codedeploy-agent/deployment-root/${DEPLOYMENT_GROUP_ID}/${DEPLOYMENT_ID}/deployment-archive/

@runlevel5
runlevel5 / gist:64ff44f7618e1c4ed1d57d470638c5e6
Created August 16, 2018 06:12
Link to download puppet learning VM
Original page: https://puppet.com/download-learning-vm/thank-you
Link: https://pe-education-vms.s3.amazonaws.com/learning/learning_puppet_vm-6.5.zip
Version: 6.5 (Quest Guide v2.3.0)
File Size: 3.2 GB
MD5: be3df9bc000b98b9aec6002f071968da
### Minimum requirements
* Internet-enabled Windows, OS X, or Linux computer with 10GB free space and a VT-x/AMD-V enabled processor.
* 4GB memory (8GB is recommended)
@runlevel5
runlevel5 / how_to_transfer_money_to_legame_with_transferwise.md
Last active June 19, 2018 10:00
How to transfer money to Legame with TransferWise?
  • Name: カブシキガイシャ レガーメ
  • Bank: 1695
  • Branch: 004
  • No: 0680377