#Country ban with UFW#
Grab your different country ip addresses and save as Linux IPTables
http://www.ip2location.com/free/visitor-blocker
##Add country## Run the following command
#Country ban with UFW#
Grab your different country ip addresses and save as Linux IPTables
http://www.ip2location.com/free/visitor-blocker
##Add country## Run the following command
Use libcluster to set up cluster automatically.
Add dependency in mix.exs and run mix deps.get
:
defp deps do
$ 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
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(), |
Source: https://yanqiyu.info/2020/08/30/fcitx5-fedora/
sudo dnf install -y fcitx5 kcm-fcitx5 fcitx5-chinese-addons fcitx5-table-extra fcitx5-zhuyin
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.
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 |
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) => { |
module PingPong # App Engine health check without a trip to DB | |
class Middleware | |
def initialize app, ping_path = '/status' | |
@app = app | |
@ping_path = ping_path | |
Rails.backtrace_cleaner.add_silencer { |line| line =~ /#{File.basename(__FILE__)}/ } | |
end | |
def pong_code | |
200 |
-- Create a group | |
CREATE ROLE readaccess; | |
-- Grant access to existing tables | |
GRANT USAGE ON SCHEMA public TO readaccess; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
-- Grant access to future tables | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |