View gist:a6ea6811362cdc0b4b2b74b8edb98581
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
const https = require('https'); | |
const axios = require('axios'); | |
const options = { | |
rejectUnauthorized: true, | |
checkServerIdentity: function(host, cert) { | |
// // Make sure the certificate is issued to the host we are connected to | |
// const err = tls.checkServerIdentity(host, cert); | |
// if (err) { | |
// return err; |
View gist:ad0862bdddcc208bef7e030f4e62d36f
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 com.example.demo; | |
import com.azure.identity.ClientSecretCredential; | |
import com.azure.identity.ClientSecretCredentialBuilder; | |
import com.google.gson.annotations.Expose; | |
import com.google.gson.annotations.SerializedName; | |
import com.microsoft.graph.authentication.TokenCredentialAuthProvider; | |
import com.microsoft.graph.content.BatchRequestContent; | |
import com.microsoft.graph.content.BatchResponseContent; | |
import com.microsoft.graph.http.HttpMethod; |
View Powerline in Putty
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
Because of 'Meslo for Powerline' font doens't work with Putty. | |
So we need another patched font to display powerline correctly. | |
Here are the list: | |
- DejaVu Sans Mono for Powerline (https://github.com/powerline/fonts/tree/master/DejaVuSansMono) | |
- Droid Sans Mono for Powerline (https://github.com/powerline/fonts/tree/master/DroidSansMono) | |
To change font: On main window (Putty Configuration) -> Window -> Apearance -> Font settings -> Change | |
To test, enter this in the terminal screen: echo "\ue0b0 \u00b1 \ue0a0 \u27a6 \u2718 \u26a1 \u2699" |
View gist:a8517e3fb11da81e5d9aeeb0c2ff19ba
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
import 'package:flutter/material.dart'; | |
void main() => runApp(new MaterialApp( | |
home: new HomePage('Dismissible Example'), | |
)); | |
class HomePage extends StatelessWidget { | |
String title; | |
final items = new List<String>.generate(10000, (i) => "Item $i"); |
View Linux Network Commands
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
Network Interface Configurator. | |
- View network settings of an ethernet adapter: | |
ifconfig eth0 | |
- Display details of all interfaces, including disabled interfaces: | |
ifconfig -a | |
- Disable eth0 interface: | |
ifconfig eth0 down |
View Backup and Restore Linux Server
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
Backup: sudo tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --exclude=/boot --one-file-system / | |
Restore: sudo tar -xvpzf /path/to/tar/file -C / --numeric-owner |
View pom.xml
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"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-parent</artifactId> | |
<version>2.1.3.RELEASE</version> | |
<relativePath/> <!-- lookup parent from repository --> | |
</parent> |
View logback-spring.xml
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
<!DOCTYPE configuration> | |
<configuration> | |
<contextName>test</contextName> | |
<jmxConfigurator/> | |
<appender name="gelf" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender"> | |
<host>udp:localhost</host> | |
<port>12201</port> | |
<version>1.1</version> |
View gist:b7a8be59680c13823943643ec3c56351
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 com.viettel.integration.hub.echoserver.controller; | |
import java.io.IOException; | |
import java.util.Base64; | |
import java.util.Collections; | |
import java.util.HashMap; | |
import java.util.Map; | |
import javax.servlet.http.HttpServletRequest; |
View Che Build
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
First time build: 40m | |
Second time build: 6m | |
[BUILD FROM SOURCE USING DOCKER] | |
cd YOUR_CHE_REPOSITORY | |
docker run -it --rm --name build-che \ | |
-v "$HOME/.m2:/home/user/.m2" \ | |
-v "$PWD":/home/user/che-build \ | |
-w /home/user/che-build \ | |
eclipse/che-dev \ |
NewerOlder