Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
export ossl_release=/opt/openssl-1.1.1-release
export C_INCLUDE_PATH=${ossl_release}/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=${ossl_release}/include:$CPLUS_INCLUDE_PATH
export LIBRARY_PATH=${ossl_release}/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=${ossl_release}/lib:$LD_LIBRARY_PATH
export PATH=${ossl_release}/bin:$PATH
#!/bin/sh
export CROSS_ROOT=/opt/toolchains/gcc-linaro-4.9.4-2017.01-x86_64_aarch64-linux-gnu
export COMPILER_PREFIX=aarch64-linux-gnu-
export AR=${CROSS_ROOT}/bin/${COMPILER_PREFIX}ar
export AS=${CROSS_ROOT}/bin/${COMPILER_PREFIX}as
export LD=${CROSS_ROOT}/bin/${COMPILER_PREFIX}ld
export RANLIB=${CROSS_ROOT}/bin/${COMPILER_PREFIX}ranlib
export CC=${CROSS_ROOT}/bin/${COMPILER_PREFIX}gcc
@a1exlism
a1exlism / gcc-security.txt
Created June 9, 2023 08:03 — forked from jrelo/gcc-security.txt
GCC security related flags reference.
Source material:
http://security.stackexchange.com/questions/24444/what-is-the-most-hardened-set-of-options-for-gcc-compiling-c-c
https://wiki.gentoo.org/wiki/Hardened_Gentoo
https://wiki.debian.org/Hardening
================================================================================================================>
GCC Security related flags and options:
CFLAGS="-fPIE -fstack-protector-all -D_FORTIFY_SOURCE=2"
LDFLAGS="-Wl,-z,now -Wl,-z,relro"
SYMBOLS = """ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] ^_`abcdefghijklmnopqrstuvwxyz{|}~"""
# LINK https://segmentfault.com/a/1190000005356779
#!/usr/bin/env python
# coding=utf-8
import sys
import time
start = time.time()
lines = 0
for each_line in sys.stdin:
class Test {
constructor() {
this.data = {
name: null,
age: -1,
attr: null
}
}
init() {
this.data = {
public class ThrowException {
public static void main(String args[]) {
try {
process1();
} catch (Exception e) {
e.printStackTrace();
}
}
static void process1() {
/*
* 生成在[a, b]范围内的随机数据
* Random numbers in the range of [a,b]
*/
#include <cstdio>
#include <cstdlib>
#include <ctime>
const int MAXN = 1000;
int main() {
int arr[MAXN];
/*
* INPUT: 100 \n
* TIPS: 输入必须有序, 否则pos无意义
* 1 10 11 11 12 12 13 15 16 18 2 2 20 20 20 20 21 21 21 22 22 22 23 23 23 23 24 24 24 24 24 27 27 28 32 35 4 40 40 40 41 42 44 44 46 47 47 5 5 52 53 54 57 58 6 60 61 62 62 63 63 64 65 65 65 69 7 70 70 71 71 72 75 75 76 77 8 8 82 84 84 85 86 86 87 89 9 9 91 91 93 93 95 95 96 97 97 98 98 99
* Search X \n
* OUTPUT: position of X
*/
#include <cstdio>
#include <algorithm>
using namespace std;
<?php
print <<<EOT
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">