Skip to content

Instantly share code, notes, and snippets.

View jamesdube's full-sized avatar
🛰️
To the moon

James Dube jamesdube

🛰️
To the moon
View GitHub Profile
@jamesdube
jamesdube / README.md
Created March 24, 2021 19:12 — forked from zoilomora/README.md
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

@jamesdube
jamesdube / update-kernel-dev.sh
Created March 16, 2021 05:52
Update Kernerl headers
sudo yum install "kernel-devel-uname-r == $(uname -r)"
@jamesdube
jamesdube / gist:dd1362e9543ccfec756ddb2a41aa830f
Created March 16, 2021 05:51 — forked from jpbougie/gist:1827065
Example of a SOAP request with Finagle
import java.net.InetSocketAddress
import scala.xml.{Elem, XML}
import org.jboss.netty.buffer.ChannelBuffers
import org.jboss.netty.util.CharsetUtil.UTF_8
import com.twitter.finagle.Service;
import com.twitter.finagle.builder.ClientBuilder;
import com.twitter.finagle.http.{Http, RequestBuilder};
import org.jboss.netty.handler.codec.http._
import org.jboss.netty.buffer.ChannelBuffers.wrappedBuffer
import java.net.URL
@jamesdube
jamesdube / vm.sh
Created February 17, 2021 09:22
Create KVM VM
sudo virt-install --name=deepin-vm-2 --os-variant="generic" --vcpu=2 --ram=2048 --graphics spice --cdrom=/mnt/data/software/isos/ubuntu-20.04-live-server-amd64.iso --disk size=10,path=/mnt/data/virtual-machines/kvmubu-3 --network bridge=virbr0
@jamesdube
jamesdube / args.sh
Created December 9, 2020 16:22
Bash Args
#!/bin/bash
PARAMS=""
while (( "$#" )); do
case "$1" in
-a|--my-boolean-flag)
MY_FLAG=0
shift
;;
-b|--my-flag-with-argument)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
@jamesdube
jamesdube / gist:7cc933040c666b50a6ac6d5d77f580f5
Created December 9, 2020 10:59 — forked from Khoulaiz/gist:41b387883a208d6e914b
Checking ports without telnet

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
@jamesdube
jamesdube / emoji-info.sh
Created December 8, 2020 20:28 — forked from yangxuan8282/emoji-info.sh
Emoji❤bash
#!/bin/bash
# run this scripts with `bash emoji-info.sh` or `./emoji-info.sh`
usage() {
cat << EOF
usage: $0 [options] <emoji>
Options:
-h Show this message
-o Octal Escape Sequence
@jamesdube
jamesdube / WebConfig.java
Created July 18, 2020 15:31 — forked from benoitdevos/WebConfig.java
Adding support for application/octet-stream in RestController (Spring Boot) - java version
package mycompany.myappp.config;
import org.apache.commons.io.IOUtils;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpInputMessage;
import org.springframework.http.HttpOutputMessage;
import org.springframework.http.MediaType;
import org.springframework.http.converter.AbstractHttpMessageConverter;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.HttpMessageNotReadableException;
@jamesdube
jamesdube / code.md
Created June 10, 2020 13:37 — forked from ChenYCL/code.md
Jetbrains IntelliJ IDEA 2019.2.4 Activation code

Please make fork of this, as this can be removed by Github.com sooner or later.

CATF44LT7C-eyJsaWNlbnNlSWQiOiJDQVRGNDRMVDdDIiwibGljZW5zZWVOYW1lIjoiVmxhZGlzbGF2IEtvdmFsZW5rbyIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiQUMiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEUE4iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImN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