This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"reflect" | |
) | |
// NatsMessage with Data field as json.RawMessage | |
type NatsMessage struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Jails vs bhyve (https://forums.freebsd.org/threads/jails-vs-bhyve.57817/) | |
# bhyve - Virtualisation: Creates a blank-disk that can be used to run an entire-OS | |
(bootloader, kernel, userland, etc.) by the virtualisation software. | |
# Jails - OS-Level Virtualisation: Jails uses the same kernel and main resources as | |
the host OS (FreeBSD). But creates a separate and isolated userland and network-space. | |
So the Jail cannot see the filesystems of the host OS. | |
It all depends on your hardware resources and needs. It would be a waste of resources to run FreeBSD inside Bhyve if using the same |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable app on xiaomi | |
pm disable-user app.package.name | |
# Re-enable it | |
pm enable app.package.name | |
# Uninstall app | |
# Sometimes uninstall command may not work without -k option on un-rooted devices | |
pm uninstall --user 0 app.package.name | |
# Install uninstalled system app | |
pm install --user 0 $(pm dump app.package.name | awk '/path/{ print $2 }') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import subprocess | |
import sys | |
import tempfile | |
if subprocess.run(["git", "branch"], stdout=subprocess.PIPE | |
).stdout.decode().strip() != "master": | |
print("WARNING! Not on the master branch.") | |
subprocess.run(["git", "pull", "--rebase"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity | |
@NamedEntityGraph(name = "graph.Order.items", | |
attributeNodes = @NamedAttributeNode("items")) | |
public class Order implements Serializable { | |
.... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start spring-boot app without depending on Database? | |
https://stackoverflow.com/questions/23850585/how-to-start-spring-boot-app-without-depending-on-database/23875516#23875516 | |
Spring boot apps will start fine even if DB is down or there is no DB. | |
Apps will pick up the connections on the fly as DB comes up which means there is no need to restart the web server or redeploy the apps. | |
There is no need to start the tomcat or redeploy the apps, if DB goes down from running state and comes up again. | |
application.yml : | |
spring: | |
datasource: | |
driverClassName: com.mysql.jdbc.Driver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://vpsfree.org | |
https://vestacp.com/ | |
http://browserstack.com | |
Good analysis. People rush to “optimize the code” but they don’t bother to measure or look for the best algorithm. | |
Bug Hunting | |
https://amybughunter.files.wordpress.com/2013/01/defect_tracking_decide1.jpg | |
# mssql jdbc driver installation in maven for now on Nexus repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run this in .m2 files | |
it lists all the corrupted jar files in the repository | |
find /home/me/.m2/repository/ -name "*jar" | xargs -L 1 zip -T | grep error | grep invalid | |
To resolve them , delete them first and re run the build or run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please note that the way how to install plugins differs from each version of Eclipse to the next one. | |
The following description is for Eclipse 3.5 - 4.3. See http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA | |
for more detailed information by the plugin provider. | |
If not installing on Windows (32-bit), i.e. on Linux, Mac OS X, or Windows 64-bit, first have a look at the notes below, | |
as you first need to install Subversion for your operating system. | |
In Eclipse, select the menu "Help > Install New Software". | |
Enter the Update Site, depending on your version of subversion you installed: | |
If you installed Subversion 1.6: http://subclipse.tigris.org/update_1.6.x | |
If you installed Subversion 1.7: http://subclipse.tigris.org/update_1.8.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<profiles version="11"> | |
<profile kind="CodeFormatterProfile" name="idiomatic" version="11"> | |
<setting id="org.eclipse.wst.jsdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/> | |
<setting id="org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/> | |
<setting id="org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/> | |
<setting id="org.eclipse.wst.jsdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/> | |
<setting id="org.eclipse.wst.jsdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/> | |
<setting id="org.eclipse.wst.jsdt.core.formatter.indent_empty_lines" value="false"/> | |
<setting id="org.eclipse.wst.jsdt.core.formatter.alignment_for_compact_if" value="16"/> |
NewerOlder