Skip to content

Instantly share code, notes, and snippets.

@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"

from http://www.sanlen.com/news/e7/2014-02-24/sl_news_41573.htm 1 范围

本标准提出了用于保护计算机与通信系统内部敏感信息的安全系统内使用的密码模块的安全要求。本标准为密码模块定义了四个安全等级,以满足不同安全等级要求的敏感数据及多样化的应用环境的安全需求。本标准划分了10个安全领域,在每种安全领域中定义了四个安全等级,每一种安全等级都比较低的安全等级提供了更高的安全性。 
本标准适用于密码模块的安全性检测,亦可用于指导密码模块的设计、开发和测试工作。 

2 规范性引用文件 

下列文件对于本文件的应用是必不可少的。凡是注日期的引用文件,仅注日期的版本适用于本文件。凡是不注日期的引用文件,其最新版本(包括所有的修改单)适用于本文件。 

GM/T 0005 随机性检测规范

#rooted shell
cat /data/misc/wifi/wpa_supplicant.conf
  1. mysql terminal import
    1. CREATE DATABASE dbname;
    2. mysql>USE dbname;
    3. mysql>SET NAMES utf8
    4. mysql>SOURCE /absolute/path/YOURs.sql;
  2. terminal import

    $mysql -uUSERNAME -p DBNAME < DBNAME.sql

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:
基本的vim 操作(有中文) http://vim.rtorr.com/
#常用:
! 强制执行
n->Enter 向下移动n行
:s/word1/word2/g 单行替换
:n1,n2s/word1/word2/g n1行和n2行之间批量替换:word2->word1
:%s/word1/word2/g 全局替换
:s/word1/word2/gc c选项==>confirm 确认选项
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];