Skip to content

Instantly share code, notes, and snippets.

@gsitgithub
gsitgithub / freebsd.txt
Last active July 26, 2021 11:04
Jails vs bhyve
# 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
@gsitgithub
gsitgithub / remove-bloatware.ps1
Created October 8, 2020 04:56
remove bloatwares from xiaomi phones
# 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 }')
@gsitgithub
gsitgithub / semver.sh
Created October 14, 2019 06:13
sircmpwn/dotfiles dotfiles/bin/semver -rwxr-xr-x
#!/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"])
@Entity
@NamedEntityGraph(name = "graph.Order.items",
attributeNodes = @NamedAttributeNode("items"))
public class Order implements Serializable {
....
@gsitgithub
gsitgithub / jpa-mapping-tips.txt
Last active August 24, 2018 11:52
JPA mapping tips
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
@gsitgithub
gsitgithub / dashboard.txt
Created August 11, 2017 13:09
java libs and tools info
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
@gsitgithub
gsitgithub / find-currupt-jars.txt
Created November 7, 2016 05:07
maven: Find corrupted jar files
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
@gsitgithub
gsitgithub / Installing the Subclipse Plugin in eclipse
Last active August 25, 2016 09:29
Subclipse Plugin in eclipse
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
@gsitgithub
gsitgithub / Java SE JDK Download archive links
Created August 11, 2016 06:32
JDK archive direct download links
@gsitgithub
gsitgithub / idiomatic-javascript-formatter-eclipse.xml
Last active October 20, 2015 08:42
Style guide javascript import XML for Eclipse JavaScript formatting
<?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"/>