Skip to content

Instantly share code, notes, and snippets.

View anhnt's full-sized avatar
🏠
Working from home

Anh anhnt

🏠
Working from home
View GitHub Profile
class io.milton.http.exceptions.BadRequestException::null
- io.milton.cloud.server.repoapps.ControllerResource.processForm(ControllerResource.java:194)
- io.milton.http.http11.PostHandler.processExistingResource(PostHandler.java:85)
- io.milton.http.ResourceHandlerHelper.processResource(ResourceHandlerHelper.java:196)
- io.milton.http.http11.PostHandler.processResource(PostHandler.java:68)
- io.milton.http.ResourceHandlerHelper.process(ResourceHandlerHelper.java:127)
- io.milton.http.http11.PostHandler.process(PostHandler.java:62)
- io.milton.http.StandardFilter.process(StandardFilter.java:50)
- io.milton.http.FilterChain.process(FilterChain.java:46)
- co.kademi.server.subscription.KademiSubscriptionFilter.process(KademiSubscriptionFilter.java:46)
@anhnt
anhnt / gist:764ea0ce7b973fecab0626a69327697f
Created October 29, 2020 08:06
payment lib doProcessCart
java.lang.NullPointerException
at co.kademi.server.catalog.CartManager.findProductsNotInStore(CartManager.java:1322)
at co.kademi.server.catalog.CartManager.checkItemsInStore(CartManager.java:1303)
at co.kademi.server.catalog.CartManager.doProcessCart(CartManager.java:445)
at jdk.nashorn.internal.scripts.Script$Recompilation$306$21096$\^eval\_.processInvoicePay#L:577(/APP-INF/app.js:589)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:117)
at io.milton.cloud.server.repoapps.ControllerMappingList.executeJs(ControllerMappingList.java:1894)
@anhnt
anhnt / log-uservisit
Created October 20, 2020 05:47
no error log but cant reindex
12:43:08.938, INFO , co.kademi.server.stream.audit.KademiAuditService, onAnyChange, onAnyChange: update to AsyncJob=421, completedDate=null takenDate=Tue Oct 20 12:43:08 ICT 2020
12:43:08.939, WARN , io.milton.cloud.server.queue.impl.DbAsyncProcessor, lambda$null$1, Took job 421
12:43:08.939, INFO , io.milton.cloud.server.queue.impl.DbAsyncProcessor, lambda$null$1, Pushed job to process queue, job ID=421 queue size is now=1
12:43:08.940, INFO , co.kademi.kademi.cache.InvalidationManager, onCommit, onCommit: invalidating 1 items
12:43:08.940, INFO , io.milton.cloud.server.queue.impl.DbAsyncProcessor, run, QueueProcessor 6 taking job 421
12:43:08.940, INFO , io.milton.cloud.server.queue.impl.DbAsyncProcessor, runJob, runJob: starting 421
12:43:09.009, INFO , io.milton.cloud.server.queue.impl.DbAsyncProcessor, lambda$runJob$8, runJob: processing 421 at Tue Oct 20 12:43:09 ICT 2020
12:43:09.010, INFO , io.milton.cloud.server.queue.impl.DbAsyncProcessor, lambda$null$4, runJob: doProcess starting (in tx), JobID=421

Keybase proof

I hereby claim:

  • I am anhnt on github.
  • I am anhng (https://keybase.io/anhng) on keybase.
  • I have a public key ASB8CyLSz6AYRH-Vkyc-bNk6Vz8m5kY6J4-gBk_vZJyevQo

To claim this, I am signing this object:

NOTE -

  • Remove -h option if you are doing operation on same machine
  • Remove -u , -p option if your database don't have username and password

Binary

Import database

mongorestore -h IP:port -d DB_Name -u user_name -p password <input db directory>
@anhnt
anhnt / gist:2ba4705fe71895d124638afce75f67d3
Created April 9, 2018 10:15 — forked from craigminihan/gist:b23c06afd9073ec32e0c
Build GCC 4.9.2 for C/C++ on CentOS 7
sudo yum install libmpc-devel mpfr-devel gmp-devel
cd ~/Downloads
curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.2/gcc-4.9.2.tar.bz2 -O
tar xvfj gcc-4.9.2.tar.bz2
cd gcc-4.9.2
./configure --disable-multilib --enable-languages=c,c++
make -j 4
make install
@anhnt
anhnt / qrencode centos
Created February 3, 2018 16:37
qrencode centos
On CentOS 6 (64-bit), I had trouble installing the qrencode dependency from source. Instead, I found it easier to install the packages qrencode and qrencode-devel from the RPMForge repo.
# Enable the rpmforge repo if you don't already have it
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm -Uvh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# Install qrencode and its libraries
yum install qrencode qrencode-devel
@anhnt
anhnt / DKIM_SPF_Sendmail
Created January 25, 2018 17:14 — forked from artmouse/DKIM_SPF_Sendmail
DKIM + SPF + Sendmail for multiple domains (Ubuntu)
DKIM is DomainKeys Identified Mail and is used in mail servers, such as Postfix or Sendmail to sign e-mails and thus authenticating the sender so that a forgery can be detected. It also reduces the possibility of an e-mail being flagged as spam, but it's not a definite prevention.
A much simpler method is using SPF (Sender Policy Framework) which, in a nutshell, verifies the sender IP address.
According to the internet, using both should result to ????, PROFIT !!!.
SPF does not need a specific configuration. Whitelisted servers are listed in a DNS record, TXT or SPF, and an example record is:
example.com. IN TXT "v=spf1 a mx ~all"
@anhnt
anhnt / reset-wsl.sh
Created January 12, 2018 09:40 — forked from ishu3101/reset-wsl.sh
Resetting your Windows Subsystem for Linux (WSL) Environment
# Resetting your Windows Subsystem for Linux (WSL) Environment
lxrun.exe /uninstall /full
lxrun.exe /install
<script>
/**
* Show error message
* @param {jQuery} form
* @param {Object} config
* @param {String|Array} message
*/
function showErrorMessage(form, config, message) {
config = getFormConfig(form, config);