Friday, 26 September 2025

OpenSource : WhatsApp Automation

Baileys API


git clone https://github.com/ookamiiixd/baileys-api.git

cd baileys-api

npm i 

npm i @adiwajshing/keyed-db

sudo npm install pm2@latest -g

pm2 start --name="baileys-api" npm -- start

Referensi

  1. WAHA - WhatsApp API, https://waha.devlike.pro/
  2. whatsapp-play, A command line software through which you can play with your WhatsApp, https://github.com/whatsplay/whatsapp-play
  3. WhatsBlaster, https://github.com/kyleissuper/WhatsBlaster
  4. Baileys - Typescript/Javascript WhatsApp Web API, https://github.com/adiwajshing/Baileys
  5. Baileys API, https://github.com/ookamiiixd/baileys-api

Monday, 15 January 2024

Vehicle Surround View

Apakah kamera seperti [10], dengan konektor rca to usb [11] dapat "dibaca" langsung di android atau minimal di linux dulu ? kalau bisa, bagaimana cara membaca ke empatnya sekaligus ? jika sudah bisa, coba pelajari dokumentasi terkait surround view [4]. 

Kalau ini bisa dilakukan, maka untuk membuat surround view di kendaraan kita, kita cukup  beli 4 buah kamera, konverter dan memanfaatkan device android yg kita punya.

Referensi

  1. The 3D surround view on Jetson Tegra TX2 platform, https://github.com/SokratG/Surround-View
  2. Cogent Surround View, https://www.cogentembedded.com/surround-view/
  3. Vehicle surround view in Libxcam, https://events19.linuxfoundation.org/wp-content/uploads/2017/11/360-Degree-Vehicle-Surround-View-in-an-Open-Source-Project-Libxcam-ALS-Junkai-Wu.pdf
  4. Surround view system, https://github.com/neozhaoliang/surround-view-system-introduction
  5. Valeo releases the first multitask fisheye camera open source dataset, aiming to take automated driving to the next level, https://www.valeo.com/en/valeo-releases-the-first-multitask-fisheye-camera-open-source-dataset-aiming-to-take-automated-driving-to-the-next-level/
  6. Automatic Surround Camera Calibration Method in Road Scene for Self-driving Car, https://arxiv.org/abs/2305.16840
  7. Head Unit Android 10 inch Nakamichi NA3102i Legend Pro Hi-Res Cam 360, https://tokopedia.link/gBtu8vBFoGb
  8. Mini WiFi Taffware IP Camera CCTV 1080P - A9, https://tokopedia.link/vphT0H6MoGb
  9. Kamera Mundur Parkir Mobil Car DVR 360 Degree Waterproof SONY Sensor, https://tokopedia.link/zjCrRj2rpGb
  10. Kamera depan Mobil universal model bulat Car DVR 360 Degree Waterproof, https://tokopedia.link/Dx6BcnuupGb
  11. Video capture card - 4 input rca to USB 2.0, https://tokopedia.link/MDON09CupGb
  12. Backup camera working with android, https://www.youtube.com/watch?v=xKDPERyunJM

Friday, 21 July 2023

Dragonfly : source-available, multi-threaded Redis® replacement built for modern cloud workloads

 

Migrasi Single Node Redis ke Dragonflydb

File backup redis : dump.rdb

Pastikan dragonlydb service sudah mati.

sudo systemctl stop dragonfly.service

load dump.rdb ke memory dengan dragonfly : 

sudo dragonfly --logtostderr --dbfilename dump

dengan redis-client, save ke format dfs :

redis-cli
save df

Hapus data lama, dan pindahkan data baru :

 sudo rm /var/lib/dragonfly/
 

dari path tadi menjalankan perintah  load dump.rdb :

sudo mv *.dfs /var/lib/dragonfly/

Jalankan dragonfly :

sudo systemctl start dragonfly.service


How to make dragonfly service start automatically in debian 12

To make the dragonfly.service start automatically in Debian 12, you can use the following steps:

  1. Open a terminal window.
  2. Run the following command to edit the dragonfly.service file:
sudo nano /etc/systemd/system/dragonfly.service
  1. In the dragonfly.service file, add the following lines to the [Unit] section:
Description=Dragonfly Service
After=network.target
  1. In the [Service] section, add the following lines:
ExecStart=/usr/bin/dragonfly
Restart=always
  1. Save the dragonfly.service file and exit the nano editor.
  2. Run the following command to reload the systemd daemon:
sudo systemctl daemon-reload
  1. Run the following command to enable the dragonfly.service service to start automatically at boot:
sudo systemctl enable dragonfly.service
  1. Run the following command to start the dragonfly.service service:
sudo systemctl start dragonfly.service

The dragonfly.service service should now start automatically at boot and whenever your system restarts.

Referensi

  1. Dragonfly, https://www.dragonflydb.io/

Thursday, 16 February 2023

rclone

 

Untuk sync google sheet dan google docs files pastikan versi rsync yg digunakan adalah versi paling akhir. 


Untuk melakukan sync seluruh file .gsheet dan .gdoc dari remote jalankan perintah ini : 


rclone sync remote: --include "**/*.gsheet" /local/path/to/destination

rclone sync remote: --include "**/*.gdoc" /local/path/to/destination

Saturday, 10 December 2022

Thursday, 26 May 2022

Moodle


Tuning

Di [1] ada instruksi untuk mengubah settingan mysql menjadi : 


[mysqld]
innodb_file_per_table = 1

character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
skip-character-set-client-handshake

Konfigurasi ini, terutama : innodb_file_per_table,  jika diterapkan di TAO, apakah dapat meningkatkan performa nya ?

Single Sign On 

Matriks fitur module-modul SAML SSO yang ada

No Moodle Plugins Auto-create user  Auto-enroll Single Sign Off Limit concurrent login Dual Login
1 Authentication ::: auth_saml2sso v
v v v
2 Authentication ::: auth_saml2 v
v
v
3






Authentication ::: auth_saml2 


auth_saml2 | duallogin : Yes/No (Default Yes)


If on, then users will see both manual and a SAML login button. If off they will always be taken directly to the IdP login page.

If passive, then the users that are already authenticated into the IDP will be automatically logged in, otherwise they will be sent to Moodle login page.

If off, then admins can still see the manual login page via /login/index.php?saml=off

If on, then external pages can deep link into moodle using saml eg /course/view.php?id=45&saml=on

If set to test IdP connection, the network will be checked for connectivity, and if functional, SAML login will be initiated.


Referensi

  1. MySQL full unicode support, https://docs.moodle.org/400/en/MySQL_full_unicode_support
  2. Auto account creation, auto enroll, https://g.co/gemini/share/572d848309ab

Tuesday, 12 October 2021

Kutt : Free Modern URL Shortener

cd /opt/webapps/kutt

sudo -u www-data pm2 startup

sudo env PATH=$PATH:/usr/bin pm2 startup systemd -u wildanm --hp /var/www

sudo -u www-data pm2 save

Referensi

  1. Kutt, a modern URL shortener with support for custom domains. Shorten URLs, manage your links and view the click rate statistics, https://github.com/openthinklabs/kutt
  2. pm2 startup script, https://pm2.keymetrics.io/docs/usage/startup/
  3. How to ensure Kutt process starts on server start? , https://github.com/thedevs-network/kutt/issues/273

Saturday, 9 October 2021

UVDesk : Open Source Helpdesk System

install extention imap 

install mailparse : pecl install mailparse


Setelah composer install, jika ada error : 

Executing script cache:clear [KO]

 [KO]

Script cache:clear returned with error code 1

!!

!!  In ArrayNode.php line 220:

!!

!!    The child node "key" at path "cspoo_swiftmailer_mailgun" must be configured

!!    .

!!

!!

!!

Script @auto-scripts was called via post-update-cmd


Ikuti langkah disini : https://github.com/tehplague/swiftmailer-mailgun-bundle/issues/74#issuecomment-428552701

 

Untuk proses update jangan menuliskan perintah composer update, tapi lakukan hal berikut : 

composer update uvdesk/core-framework
composer update uvdesk/support-center-bundle
composer update uvdesk/mailbox-component
composer update uvdesk/automation-bundle
composer update uvdesk/extension-framework

 php bin/console swiftmailer:email:send --to=to@gmail.com --from='from@gmail.com'' --subject="test from cli" --body=test --mailer=smtp.mail.com

smtp

Mailgun


composer require cspoo/swiftmailer-mailgun-bundle php-http/guzzle5-adapter
composer require guzzlehttp/psr7

Error : 

doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php:90)"} []
[2021-10-13 08:15:51] php.CRITICAL: Call to undefined method cspoo\Swiftmailer\MailgunBundle\Service\MailgunTransport::setPassword() {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to undefined method cspoo\\Swiftmailer\\MailgunBundle\\Service\\MailgunTransport::setPassword() at /opt/webapps/uvdesk/vendor/uvdesk/core-framework/Services/EmailService.php:500)"} []

Solusi : 

Pada file vendor/cspoo/swiftmailer-mailgun-bundle/Service/MailgunTransport.php

tambahkan properties dan methods berikut : 

        /**
     * The password for authentication.
     *
     * @var string
     */
    private $password;

    /**
     * Set the password to authenticate with.
     *
     * @param string $password
     */
    public function setPassword($password)
    {
        $this->password = $password;
    }
    
    
    /**
     * Get the password to authenticate with.
     *
     * @return string
     */
    public function getPassword()
    {
        return $this->password;
    }    

Perubahan ini sudah diterapkan pada openthinklabs/swiftmailer-mailgun-bundle

Konfigurasi .env : 
MAILER_URL=smtp://smtp.mailgun.org:587?encryption=tls&username=ausername&password=apassword
###< symfony/swiftmailer-bundle ###
MAILGUN_DOMAIN="domain.com"
MAILGUN_API_KEY="domain_key"
MAILGUN_SENDER="info@domain.com"


Untuk mengetes mengirim email, gunakan perintah : 

php bin/console swiftmailer:email:send --from=<from email> --to=<to email> --subject="Foo" --body="Bar" 

MailBox


Contoh konfigurasi yang dapat digunakan adalah seperti ini: 

config/packages/uvdesk_mailbox.yaml


Untuk menarik data dari mailbox, dapat menggunakan perintah : 

php bin/console uvdesk:refresh-mailbox email-address@example.com

Buat cron job untuk mengeksekusi perintah ini secara rutin, misal setiap 15 menit sekali. 

Mac


Jika perintah ini dijalankan di Mac, maka kita akan mendapatkan error : 

....
 Mailbox refreshed successfully !!!
PHP Fatal error:  Uncaught ErrorException: Notice: Unknown: [ALERT] Filesystem notification initialization error -- contact your mail administrator (check for configuration errors with the FAM/Gamin library) in Unknown:0
Stack trace:
#0 [internal function]: Symfony\Component\Debug\ErrorHandler->handleError(8, 'Unknown: [ALERT...', 'Unknown', 0, NULL)
#1 {main}
  thrown in Unknown on line 0

Fatal error: Uncaught ErrorException: Notice: Unknown: [ALERT] Filesystem notification initialization error -- contact your mail administrator (check for configuration errors with the FAM/Gamin library) in Unknown:0
Stack trace:
#0 [internal function]: Symfony\Component\Debug\ErrorHandler->handleError(8, 'Unknown: [ALERT...', 'Unknown', 0, NULL)
#1 {main}
  thrown in Unknown on line 0

Referensi 

  1. composer update caused uvdesk broken, https://github.com/uvdesk/community-skeleton/issues/263
  2. SSL3_GET_SERVER_CERTIFICATE:certificate verify failed #544, https://github.com/swiftmailer/swiftmailer/issues/544
  3. How to Setup Mailbox : UVdesk Open Source Helpdesk, https://www.uvdesk.com/en/blog/setup-mailbox-uvdesk-open-source-helpdesk/
  4. UVdesk- Custom Field, https://webkul.com/blog/uvdesk-custom-fields/

Wednesday, 8 September 2021

Utilities untuk Zendesk

 Export Tickets

Jika berlangganan paket Suite Team, maka kita tidak akan mendapat akses ke fungsionalitas Report untuk mengexport data ticket-ticket yang masuk. Jika menggunakan custom view, yg bisa diexport hanya 2000 tiket. 

Ada beberapa solusi menggunakan API yg telah dibuat oleh komunitas. Dintaranya timpalac/zendeskexport [1], kelemahannya, hanya bisa meng-export maksimal 1000 tiket dalam satu requeat. 

Zenpy pun menawarkan solusi, salah satu nya adalah yg telah ditulis oleh Paul [2][3], tapi sepertinya API nya sudah kadaluarsa (?). Setelah mencoba memodifikasi script diatas, Alhamdulillah, akhirnya bisa menarik data tiket Zendesk : 

credentials = {
'email' : 'email',
'token' : 'token',
'subdomain': 'subdomain'
}

# Import the Zenpy Class
from zenpy import Zenpy
from django.utils import timezone
import requests
import pandas as pd
import datetime as dt
import json
import time

zenpy_client = Zenpy(**credentials)

def export_data(start_date = dt.datetime(2020, 1, 1, tzinfo=timezone.utc)):

tickets_json = '['
tickets_df = pd.DataFrame()
org_df = pd.DataFrame()
users_df = pd.DataFrame()
df_tickets = pd.DataFrame(columns=['id', 'requester_id', 'submitter_id',
'created_at', 'subject', 'description',
'tags', 'channel', 'status'])

result_generator = zenpy_client.tickets.incremental(start_time=start_date, include=['users','organizations','groups'])
for ticket in result_generator:
ticket = ticket.to_dict()
row = {
'id': ticket['id'],
'requester_id': ticket['requester_id'],
'submitter_id': ticket['submitter_id'],
'created_at': ticket['created_at'],
'subject': ticket['subject'],
'description': ticket['description'],
'tags': ticket['tags'],
'channel': ticket['via']['channel'],
'status': ticket['status'],
}

df_tickets = df_tickets.append(row, ignore_index=True)

print(str(len(df_tickets)) +" Tickets Imported")



df_tickets.to_csv('tickets_export_20200101_20210908.csv')


export_data()



Dari ekosistem Pentaho, ada yang menawarkan plugin untuk Zendesk [4], tapi ketika mencoba untuk dibuild, masih error : 

[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< org.pentaho.pdi:pdi-zendesk-plugin >-----------------
[INFO] Building PDI Zendesk Plugin 1.3.2-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.149 s
[INFO] Finished at: 2021-09-08T20:07:24+07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.pentaho.maven.plugins:license-helper-maven-plugin:1.26 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.pentaho.maven.plugins:license-helper-maven-plugin:jar:1.26: Could not transfer artifact org.pentaho.maven.plugins:license-helper-maven-plugin:pom:1.26 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [pentaho-public (http://nexus.pentaho.org/content/groups/omni/, default, releases+snapshots)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

Referensi

  1. ZenDesk Export, https://github.com/timpalac/zendeskexport
  2. Zenpy, https://github.com/facetoe/zenpy
  3. How to Export all Tickets from Zendesk using the API and Python, https://www.pauldesalvo.com/how-to-export-all-tickets-from-zendesk-using-the-api-and-python/
  4. Zendesk Plugin for PDI, https://github.com/matthewtckr/pdi-zendesk-plugin

Monday, 12 July 2021

Goole Data Studio

Choropleth Map


Beberapa Provinsi yg belum masuk ke GeoChart : Papua Barat dan Maluku, tapi jika menggunakan code provinsi dari ISO_3166-2:ID, bisa, seperti dijelaskan di [4]

Referensi

Tuesday, 6 July 2021

Thursday, 29 April 2021

Social Network Analysis

Agar dapat dijalan dibackground dan tetap berjalan meskipun kita exit dari ssh, dapat menggunakan nohup : 

scrapy crawl TweetScraper -a query=TKA CHINA since:2020-05-10 until:2020-05-16

Data hasil scraping disimpan ke database [5], hanya untuk memprosesnya, untuk mempermudah, kita dapat menggunakan Pentaho Data Integration [6]. 

Jika ada masalah ketika memproses data ke database dengan Pentaho, bisa membaca [7][8]. 

Untuk analisa dan visualisasi dengan Gephi dapat membaca [10], hanya saja, dataset yg disebutkan disini, sudah tidak dapat diakses lagi. 

Jika ingin menggunakan Gephi - Twitter Streaming Importer dapat menonton [11].

Referensi

  1. TweetScraper,  https://github.com/jonbakerfish/TweetScraper
  2. Python Tutorial: Understanding Twitter JSON, https://www.youtube.com/watch?v=qrruEhHqwqY
  3. Text Mining, Networks and Visualization: Plebiscito Tweets, https://juanitorduz.github.io/text-mining-networks-and-visualization-plebiscito-tweets/
  4. Building a network graph from Twitter data, https://towardsdatascience.com/building-a-network-graph-from-twitter-data-a5e7b8672e3
  5. Building Twitter Conversation Graph, https://medium.com/analytics-vidhya/building-twitter-conversation-graph-5830bee5a7eb
  6. JSON-Input, https://pentaho.home.blog/2019/04/21/json-input/
  7. Incorrect string value: '\xF0\x9F\x8E\xB6\xF0\x9F…' MySQL , https://stackoverflow.com/questions/20411440/incorrect-string-value-xf0-x9f-x8e-xb6-xf0-x9f-mysql
  8. Emoji characters can't be written to Mysql database, https://www.programmersought.com/article/9501164118/
  9. Social Network Analysis and Visualization in Gephi, https://www.uu.nl/sites/default/files/clue_training_gephi.pdf
  10. Analyzing and visualizing your Twitter networks in Gephi , https://www.uu.nl/sites/default/files/analyzing_and_visualizing_your_twitter_networks_in_gephi.pdf
  11. Lab 11 Collect and Visualize #Twitter Social Network in #Gephi, https://www.youtube.com/watch?v=yYd8nSQRpis
  12. How to work with bigger datasets in Gephi, https://www.databulle.com/blog/random/gephi-ram.html
  13. Social Feed Manager, Helping researchers and archivists build social media collections, https://gwu-libraries.github.io/sfm-ui/

Tuesday, 2 February 2021

Stress Test dengan Locust

  Pertanyaan :

  1. Bagaimana cara melakukan stress test untuk TAO ? Login, kemudian klik delivery dan mengerjakan soal pertama dan seterusnya sampai end test. 
Real Browser support for Locust.io tidak mendukung Locust versi terbaru. Locust lebih untuk melakukan load test terhadap API end point. Mungkin bisa juga, mimicking real browser, ketika mengakses halaman, Locut mendownload semua asset nya, tapi tentu, tidak akan se-real, ketika menggunakan load test dgn real browser seperti WDS selenium.  

Referensi

  1. Locust, An open source load testing tool. https://locust.io/
  2. Real Browser support for Locust.io load testing, https://github.com/nickboucart/realbrowserlocusts
  3. extension-tao-oauth, Extension to easily configure an OAuth client for OAT platform., https://github.com/OpenThinkLabs/extension-tao-oauth
  4. Say Goodbye To Apache JMeter Drupal Load Testing with Locust.io, https://www.tag1consulting.com/blog/drupal-loadtest-locust

Sunday, 31 January 2021

Stress Test dengan JMeter

 Pertanyaan :

  1. Bagaimana cara melakukan stress test untuk TAO ? Login, kemudian klik delivery dan mengerjakan soal pertama dan seterusnya sampai end test. 

JMeter dan Selenium Webdriver 

Paduan JMeter dan Selenium Webdriver, setelah dicoba, sepertinya hanya cocok untuk keperluan functional testing, tidak cocok untuk load testing, karena 1 virtual user itu menggunakan 1 CPU, jadi jika ingin mensimulasikan, misal, 1000 concurrent user, agak berat [6]. 


Solusi alternatif yg ditawarkan, adalah menggunakan locust.io, tapi karena kita perlu testing, yang mendukung javascript, apakah  limitasi diatas masih berlaku ?

Referensi

  1. How to monitor End User Response Time of your Web Applications using JMeter + Webdriver, Containers, and Azure Pipelines. https://medium.com/microsoftazure/how-to-monitor-end-user-response-time-of-your-web-applications-using-jmeter-webdriver-4a609cbb4b57
  2. Web Driver Sampler, https://jmeter-plugins.org/wiki/WebDriverSampler/
  3. How to Fix Selenium’s “Element Is Not Clickable at Point”, https://www.testim.io/blog/selenium-element-is-not-clickable-at-point/
  4. Leverage your Load Testing using JMeter and Selenium WebDriver, https://www.ubik-ingenierie.com/blog/leverage-your-load-testing-using-jmeter-and-selenium-webdriver/
  5. Selenium API Docs, https://www.selenium.dev/selenium/docs/api/java/index.html?overview-summary.html
  6. How To Put Multiple User Loads Like ( 100 , 200 Users ) on a Premade Selenium Script In Python Webdriver In Odoo?, https://stackoverflow.com/questions/32437816/how-to-put-multiple-user-loads-like-100-200-users-on-a-premade-selenium-sc