Skip to content

Instantly share code, notes, and snippets.

###
### .procmailrc
###
### - Host name: mail.example.com (CentOS 7, postfix, dovecot)
### - Private network: 192.168.0.0/16
###
# Forward spam mails to IMAP Junk folder
:0
* ^Received: from .*\(unknown \[[0-9\.]+\]\).*by mail\.example\.com
@ura14h
ura14h / build.sh
Created July 7, 2022 10:06
Build libOpenCvSharpExtern.so
#!/bin/bash
#
# Build libOpenCvSharpExtern.so for
# linux-arm, linux-arm64: Raspberry Pi OS (Bullseye)
# linux-x86-64: Ubuntu 20.04
opencvsharp_version="4.6.0.20220608"
opencv_version="4.6.0"
opencv_folder="${HOME}/opencv-build"
opencv_output="/usr/local"
@ura14h
ura14h / sample.bat
Created June 13, 2022 01:00
Nuitka and Windows
python -m venv .venv
call .venv\Scripts\activate.bat
python -m pip install --upgrade pip
python -m pip install nuitka zstandard
python -m nuitka --follow-imports --onefile program.py
program.exe
@ura14h
ura14h / sampleapp.sh
Last active November 13, 2021 04:42
Build .NET 6.0 GUI Application for macOS
# Build .NET 6.0 GUI Application for macOS
### Setup .NET 6.0
$ brew install --cask dotnet-sdk
$ sudo dotnet workload install maui
### Create project
$ dotnet new maui -n sampleapp
$ cd sampleapp/
@ura14h
ura14h / Program.cs
Last active July 17, 2021 02:30
Simple .NET Core Web Server
using System;
using System.Net;
using System.Text;
namespace server
{
class Program
{
static void Main(string[] args)
{
@ura14h
ura14h / ListAppBundleFolders.sh
Created May 6, 2021 05:50
List app's bundle folders in the user library (macOS)
#!/bin/sh
#
# List app's bundle folders in the user library
#
targets=($(xcodebuild -list | awk '/Targets:/,/^$/' | grep -Ev '(^$|:)' | sed -e 's/ //g'))
for target in ${targets[@]}
do
bundles=($(xcodebuild -showBuildSettings -target ${target} | awk '/PRODUCT_BUNDLE_IDENTIFIER/ {print $3}'))
for ((bundle_i = 0; bundle_i < ${#bundles[@]}; bundle_i++))
@ura14h
ura14h / update_rocketchat.log
Created November 4, 2018 03:11
Updating Rocket.Chat failed.
# Rocket.Chat cloned from GitHub uses private mongodb and Meteor does not include `mongodump` and `mongorestore`.
# How to upgrade Rocket.Chat with keeping database is no ways. :-(
# Update Rocket.Chat.
#
$ cd ~/(path-to)/Rocket.Chat
$ git checkout develop
$ git fetch upstream
$ git rebase upstream/develop
$ meteor npm install
@ura14h
ura14h / update_rocketchat.sh
Last active October 25, 2018 03:01
Update Rocket.Chat
#!/bin/bash
#
# Rocket.Chat Updater
# - CentOS 7.5
# - The installed path of Rocket.Chat is /opt/rochetchat
#
echo "Update Rocket.Chat"
cd /opt/
@ura14h
ura14h / network.swift
Created August 7, 2018 07:09
Using Network.Framework sample for iOS12
// Using Network.Framework sample for iOS12.
// a server must run the command:
// $ nc -l 3000
import UIKit
import Network
let connection = NWConnection(
host: NWEndpoint.Host("localhost"),
port: NWEndpoint.Port(rawValue: 3000)!,
@ura14h
ura14h / gist:c91f1dafd30cc029f58cf0bb5e74386c
Created April 24, 2018 00:46
How to install TensorFlow and Keras on Windows 10
See also: http://starpentagon.net/analytics/tensorflow_cpu_mode_windows_install/
How to install TensorFlow and Keras on Windows 10
* Install... https://repo.anaconda.com/archive/Anaconda3-5.1.0-Windows-x86_64.exe
* Open... 'Anaconda3' > 'Anaconda Prompt'
* Type commands...
---
(base) > conda create -n tensorflow pip python=3.6
(base) > conda activate tensorflow