Skip to content

Instantly share code, notes, and snippets.

View ukazap's full-sized avatar

ukazap

View GitHub Profile
@ukazap
ukazap / chinese-input-fedora-35-kde.md
Last active April 9, 2025 13:10
How to set up Chinese input methods on Fedora 35 (KDE)

How to set up Chinese input methods on Fedora 35 (KDE)

Source: https://yanqiyu.info/2020/08/30/fcitx5-fedora/

Install fcitx5, fcitx5 configuration tool, Pinyin & Zhuyin input method engines

sudo dnf install -y fcitx5 kcm-fcitx5 fcitx5-chinese-addons fcitx5-table-extra fcitx5-zhuyin
@ukazap
ukazap / UFW_ban_country.md
Created November 1, 2023 12:34 — forked from jasonruyle/UFW_ban_country.md
UFW to block countries
@ukazap
ukazap / riak_core_cluster_formation.md
Last active September 27, 2022 06:28
riak_core cluster formation

riak_core cluster formation

Set up libcluster

Use libcluster to set up cluster automatically.

Add dependency in mix.exs and run mix deps.get:

defp deps do
@ukazap
ukazap / observer.md
Created July 19, 2022 04:31 — forked from pnc/observer.md
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
@ukazap
ukazap / queue.ex
Created June 9, 2022 04:16
Elixir wrapper for `:queue`
defmodule Queue do
@moduledoc """
Wrapper for Erlang's :queue with optional `max_length` and O(1) `.length` query.
"""
alias __MODULE__
@type t :: %Queue{
q: {list(), list()},
length: pos_integer(),

Keybase proof

I hereby claim:

  • I am ukazap on github.
  • I am ukazap (https://keybase.io/ukazap) on keybase.
  • I have a public key ASDaB0Vp2caiWvh3Ku-tTGSQOIZLZxQAj-s5izDOBy0rpwo

To claim this, I am signing this object:

@ukazap
ukazap / ubuntu-20.04-macbook-pro.md
Created January 10, 2021 12:47 — forked from johnjeffers/ubuntu-20.04-macbook-pro.md
Ubuntu 20.04 on a 15" Retina MacBook Pro (Mid-2014)

Ubuntu 20.04 on a 15" Retina MacBook Pro (Mid-2014)

These are notes from my efforts to get Ubuntu 20.04 installed on my older MacBook Pro. I'm making this gist public in the hopes that it's helpful to others.

I did a Minimal install, but selected the option to install additional 3rd-party drivers.

Wifi doesn't work during the install (because it requires a 3rd-party driver), so you won't be able to choose to download updates while installing. No big deal, run a software update after the install.

The installer takes about 25 minutes to complete. Post-install, most things work. The only driver I had to manually install was for the FaceTime camera. More on that below.

@ukazap
ukazap / vhosts.bat
Created April 14, 2015 08:18
Windows batch script for creating new virtual host entries on Apache.
@echo off
set texteditor=subl rem Text editor of your choice e.g. Sublime Text (subl)
set hostsfile=C:/Windows/System32/drivers/etc/hosts rem Where Windows' hosts file is located
set vhostsfile=C:/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf rem This one depends on your installation.
set htdocs=C:/wamp/www rem This one depends on your installation.
if ["%1"] == ["edit"] goto:edit
if ["%1"] == ["add"] goto:add
goto:usage
FROM ukazap/ruby:dev-bionic-2.6.3 AS dev
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
apt install -y tmux nodejs && npm install -g yarn && \
/usr/bin/rbenv exec gem install foreman
WORKDIR /app
EXPOSE 3000
EXPOSE 3035
ENV WEBPACKER_DEV_SERVER_HOST=0.0.0.0
CMD /bin/bash
@ukazap
ukazap / environment.js
Created September 24, 2019 01:51 — forked from wingrunr21/environment.js
Simple webpacker server side rendering
const webpack = require('webpack')
const { environment } = require('@rails/webpacker')
// Don't use commons chunk for server_side_render chunk
const entries = environment.toWebpackConfig().entry
const commonsChunkEligible = Object.keys(entries).filter(name => name !== 'server_side_render')
environment.plugins.set('CommonsChunkVendor', new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: (module, count) => {