Skip to content

Instantly share code, notes, and snippets.

View liweinan's full-sized avatar
🐢

阿男 liweinan

🐢
View GitHub Profile
@jianwu
jianwu / mshell
Last active October 27, 2021 12:50
mshell: to run jshell for a maven project with all the dependancies injected.
# Run this script from the maven module directory to start a jshell with
# all dependent class paths injected.
# Please never run it on the parent maven project directory.
# It depends on java9 or above
if [ ! -d "target" ]; then
echo "Please run it under a module directory. And make sure it's not parent module directory. And make a maven install first"
exit
fi
@maecapozzi
maecapozzi / create-react-app.md
Created December 12, 2017 15:28
Cheat Sheet for create-react-app
  1. Install create-react-app globally npm install -g create-react-app

  2. Create a new application create-react-app <name-of-application>

  3. Run server npm start inside of the applications directory.

@ricardozanini
ricardozanini / How-to-add-custom-spring-module-wildfly.md
Last active December 9, 2020 03:12
Add a Spring Framework Web Custom module to Wildfly/JBoss/EAP
  1. Create a module.xml file in $JBOSS_HOME/modules/org/springframework/${spring-version}:
<?xml version="1.0"?>
<module xmlns="urn:jboss:module:1.1" name="org.springframework" slot="${spring-version}">
    <resources>
            <resource-root path="aopalliance-1.0.jar" />
            <resource-root path="spring-aop-${spring-version}.jar" />
            <resource-root path="spring-beans-${spring-version}.jar" />
            <resource-root path="spring-context-${spring-version}.jar" />
@jganzabal
jganzabal / Nvidia Titan XP + MacBook Pro + Akitio Node + Tensorflow + Keras.md
Last active November 2, 2022 11:43
How to setup Nvidia Titan XP for deep learning on a MacBook Pro with Akitio Node + Tensorflow + Keras
@maxivak
maxivak / __readme.md
Last active January 19, 2024 15:00
Load code in libraries in Rails 5

Load lib files in production (Rails 5)

If you have your code defined in classes in lib/ folder you may have problems to load that code in production.

Autoloading is disabled in the production environment by default because of thread safety.

Change config/application.rb:

    config.autoload_paths << Rails.root.join("lib")
 config.eager_load_paths &lt;&lt; Rails.root.join("lib")
@prehensilecode
prehensilecode / vboxmanage_cheat_sheet.txt
Last active October 18, 2019 02:00
VirtualBox commandline cheat sheet
# start a guest in headless mode
vboxmanage startvm guestvmname --type headless
# add a nic (number 2) to guest, setting it to be on the host-only network, and make it a virtio device
vboxmanage modifyvm guestvmname --nic2 hostonly --nictype2 virtio --hostonlyadapter2 vboxnet0
# remove nic number 2
vboxmanage modifyvm guestvmname --nic2 none
# turn on host i/o cache - needed for the virtual disk on ext4 on older kernels
package javax0.j9regex.samples;
import org.junit.Test;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static org.junit.Assert.assertEquals;
@kay21s
kay21s / Disable ASLR
Last active October 27, 2019 01:00
Disable ASLR in the system
Disable: echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
Enable: echo 2 | sudo tee /proc/sys/kernel/randomize_va_space
But the above configuration will be canceled after a reboot.
For permanent configuration:
Add a file /etc/sysctl.d/01-disable-aslr.conf containing: kernel.randomize_va_space = 0
sudo docker run -it --network none --privileged --device=/dev/uio1:/dev/uio1 -v /var/run:/var/run -v /mnt/huge/:/mnt/huge/ -v /home/kai/openNetVM/:/openNetVM -w=/ --name=test ubuntu:14.04 /bin/bash
@chris-79
chris-79 / arch-linux-on-raspberry-pi.md
Last active June 8, 2018 11:56
Installing Arch Linux on Raspberry Pi