Skip to content

Instantly share code, notes, and snippets.

View sailfish009's full-sized avatar

sailfish009

  • freelancer
  • South Korea
View GitHub Profile
# reasonable dns setting
# https://blobfolio.com/2017/05/fix-linux-dns-issues-caused-by-systemd-resolved/
/etc/resolv.conf
# Google DNS
nameserver 8.8.8.8
nameserver 8.8.4.4
# Debian/Ubuntu
# nginx 1.17.10, openssl 1.1.1f, pcre 8.44, zlib 1.2.11, perl 5.26.1
./configure --prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--user=nginx \
--prefix=/usr --openssldir=/usr/lib/ssl --libdir=lib/x86_64-linux-gnu no-idea no-mdc2 no-rc5 no-zlib no-ssl3 enable-unit-test no-ssl3-method enable-rfc3779 enable-cms
# https://forums.fast.ai/t/focalloss-with-multi-class/35588/2
def one_hot_embedding(labels, num_classes):
return torch.eye(num_classes)[labels.data.cpu()]
class myCCELoss(nn.Module):
def __init__(self):
super(myCCELoss, self).__init__()
sudo pip uninstall matplotlib
sudo apt-get install python-matplotlib
@sailfish009
sailfish009 / spawn.cpp
Created March 26, 2020 04:04 — forked from konstantint/spawn.cpp
Example of communication with a subprocess via stdin/stdout
//
// Example of communication with a subprocess via stdin/stdout
// Author: Konstantin Tretyakov
// License: MIT
//
#include <ext/stdio_filebuf.h> // NB: Specific to libstdc++
#include <sys/wait.h>
#include <unistd.h>
#include <iostream>
https://www.learningsomethingnew.com/vue-cli-router-vuetify-plugins
npm install acorn --no-bin-links
https://medium.com/repro-repo/build-pytorch-from-source-on-ubuntu-18-04-1c5556ca8fbf