Skip to content

Instantly share code, notes, and snippets.

View ugifractal's full-sized avatar

sugiarto ugifractal

View GitHub Profile
mv /Users/sugiarto/Library/Containers/com.docker.docker /Users/sugiarto/Library/Containers/com_docker_docker
mkdir /Volumes/docker/com.docker.docker
ln -s /Volumes/docker/com.docker.docker /Users/sugiarto/Library/Containers/com.docker.docker
cp -r /Users/sugiarto/Library/Containers/com_docker_docker/* /Volumes/docker/com.docker.docker/
@ugifractal
ugifractal / mosquitto.conf
Created December 4, 2020 03:59
sample auth plugin for mqtt http /usr/local/etc/mosquitto/mosquitto.conf
auth_plugin /Users/sugiarto/my_apps/sugi/goapp/mosquitto-go-auth/go-auth.so
auth_opt_backends http
auth_opt_http_host localhost
auth_opt_http_port 8000
auth_opt_http_getuser_uri /mqtt/get_user
auth_opt_http_response_mode status
auth_opt_http_params_mode json
auth_opt_http_aclcheck_uri /mqtt/get_acl
@ugifractal
ugifractal / gist:8295f86d29119a450f3644f7b190284c
Created December 2, 2020 22:38
Noticed gem error ActiveRecord::RecordInvalid (Validation failed: xxxx must exist):
When sending notification using rails jumpstart and noticed gem I got following error:
NewLead.with(account: Account.first, lead: lead).deliver(User.find(lead.receiver_id))
and got Error performing Noticed::DeliveryMethods::Database (Job ID: 50b96038-e794-4b3b-b9aa-76c400876daa) from Async(default) in 112.37ms: ActiveRecord::RecordInvalid (Validation failed: Account must exist):
This happen because account_id missing on attributes.
Fixed by adding "format" to "deliver_by" at new_lead.rb
# To deliver this notification:
@ugifractal
ugifractal / ffi gem install
Created November 17, 2020 06:42
install ffi gem
gem install ffi -v ‘1.9.23’ -- --with-ldflags=-L/usr/local/Cellar/libffi/3.3/lib --with-cppflags=-I/usr/local/Cellar/libffi/3.3/include --with-cflags=“-Wno-error=implicit-function-declaration”
@ugifractal
ugifractal / rpi_using_usb_soundcard.txt
Created July 30, 2019 11:35
set raspberry pi 3 to use usb soundcard as default
$ sudo nano /usr/share/alsa/alsa.conf
then update from:
defaults.ctl.card 0
defaults.pcm.card 0
become:
@ugifractal
ugifractal / auto_start_app_for_openauto.txt
Last active July 30, 2019 11:32
this is how I made openauto start automatically on raspberry
$ cd ~/.config
$ mkdir autostart
$ cd autostart
$ sudo nano autoapp.desktop
then copy this:
[Desktop Entry]
Name=Autoapp
Exec=sudo /home/pi/openauto/bin/autoapp
@ugifractal
ugifractal / openauto_install.txt
Last active May 4, 2023 04:25
installation open auto
- Preparing required package
$ sudo apt-get update
$ sudo apt-get install -y libboost-all-dev libusb-1.0.0-dev libssl-dev cmake libprotobuf-dev protobuf-c-compiler protobuf-compiler
$ sudo apt-get install -y libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediawidgets5 qtmultimedia5-dev libqt5bluetooth5 libqt5bluetooth5-bin qtconnectivity5-dev pulseaudio librtaudio-dev librtaudio5a
- Build aasdk
cd ~
Fork abraha2d's aasdk to your account
$ git clone https://github.com/USERNAME/aasdk.git
@ugifractal
ugifractal / fix.txt
Created June 29, 2019 02:21
fixing react-native version mismatch
yarn react-native upgrade
rm -rf node_modules
yarn
expo client:install:android
expo start
@ugifractal
ugifractal / util.rb
Created November 22, 2018 13:46
ruby Method using Faraday to send push notification on onesignal API
def self.onesignal_notify(user, message)
headers = {
"Authorization" => "BASIC #{APP_CONFIG['onesignal']['api_key']}",
"Content-Type" => "Application/json"
}
body = {
"app_id" => APP_CONFIG['onesignal']['app_id'],
"data" => {"type": "post"},
"contents" => {"en" => message},
#"include_player_ids" => [user.onesignal],
id cofog1code cofog2code cofog3code cofog1label cofog2label cofog3label amount time
1431772969128-10 01 01.1 01.1.1 General public services Executive and legislative organs, financial and fiscal affairs, external affairs Executive and legislative organs 1 2015
1431772969128-11 01 01.1 01.1.2 General public services Executive and legislative organs, financial and fiscal affairs, external affairs Financial and fiscal affairs 1 2015