Skip to content

Instantly share code, notes, and snippets.

View 911992's full-sized avatar

911992

View GitHub Profile
@911992
911992 / c_trigraphs_example.c
Created March 5, 2020 20:26
C trigraphs, and some little tip for obfuscating
%:include <stdio.h>
main(void) ??<
char _vls<:4:>=<%1,3,5,7%>;
printf("val:%d ??/n", 1??(_vls??) );
??>
/*
Above code equals to following code.
Prints 3.
*/
@911992
911992 / for_loop_asm.c
Created March 15, 2020 13:37
Using one loop(for ,e.g. 1 X 16) instead of two(for-for, e.g. 4X4) for performance stuffs
/**
#compile:
gcc -S -fverbose-asm -g -O0 <<FILE>>.c -O <<FILE>>.s
#asm
as -alhnd <<FILE>>.s > <<FILE>>.lst
#related course
https://www.youtube.com/watch?v=ulJm7_aTiQM
*/
/*using one loop instead of two (nested loop)*/
/*
* Copyright (c) 2020, https://github.com/911992 All rights reserved.
* License BSD 3-Clause (https://opensource.org/licenses/BSD-3-Clause)
*/
/*
sample_code_java0
File: Charset_Test.java
Created on: May 28, 2020 7:19:32 PM
@author https://github.com/911992
#include <stdio.h>
int main(void) {
int _jp_tsu = 'ッ';
printf("Tsu: %x\n",_jp_tsu);
return 0;
}
//out: Tsu: e38383
#include <stdio.h>
/*learn C, the confusing approach*/
/*teacher: (⌐■_■)*/
/*student: (╯°□°)╯︵ ┻━┻*/
int main(void) ??<
char _vls<:012:>=\
<%0x43,040,105,0x73,0x20,0103,\
79,0x4f,76,-0%>;
printf("%s??/n", &(0x00??(_vls??)));
@911992
911992 / struct_padding.c
Created June 30, 2020 15:50
C Struct Padding Example
#include <stdio.h>
/*Author: https://github.com/911992*/
typedef struct s{
int b;
char f;
char _data[9];
};
@911992
911992 / AutoCloseable_Type.java
Created July 2, 2020 21:25
java try-with-resources AutoCloseable example
/*@author https://github.com/911992*/
class My_Closeable_Type implements AutoCloseable
{
public static void main (String arg_args[])
{
try(My_Closeable_Type _ins = new My_Closeable_Type()){
}/*will call close() automatically*/
}
@911992
911992 / windfly_add-user.md
Created August 12, 2020 18:04
Adding user to windfly

By default using ./bin/add-user.sh|cmd file should work.

But if add-user.bat result a failed resp by The system cannot find the path specified. message, you may go like following

  1. head into the wildfly root folder.

  2. use following command (template)

java -Djboss.server.config.user.dir=<<address of configuration folder, example: ./standalone/configuration>>
-Djboss.domain.config.user.dir=&lt;&gt;
@911992
911992 / Gson_Transient.java
Created September 18, 2020 10:25
including transient field in gson
/*
* Lic: BSD 3.0
*/
/*
sample_code_java0
File: Gson_Transient.java
Created on: Sep 18, 2020 1:51:02 AM
@author https://github.com/911992
@911992
911992 / Gson_Transient1.java
Created September 18, 2020 10:45
including transient field in gson
/*
* Lic: BSD 3
*/
/*
sample_code_java0
File: Gson_Transient1.java
Created on: Sep 18, 2020 2:33:06 AM
@author https://github.com/911992