Skip to content

Instantly share code, notes, and snippets.

View jybaek's full-sized avatar
👨‍💻
It's so fun!

JB jybaek

👨‍💻
It's so fun!
View GitHub Profile
@jybaek
jybaek / string_compare.sh
Created December 15, 2015 03:17
string compare
#!/bin/sh
AA="My name is oops"
BB="name"
if [[ "$AA" == *"name"* ]];then
echo "1st find it"
fi
if [[ "$AA" =~ "name" ]];then
@jybaek
jybaek / hashBug.php
Created December 2, 2015 00:40
PHP의 오래된 해시 비교 버그
<?php
// 출처 : https://blog.whitehatsec.com/magic-hashes/
if (hash('md5','240610708',false) == '0') {
print "Matched.\n";
}
if ('0e462097431906509019562988736854' == '0') {
print "Matched.\n";
}
?>
@jybaek
jybaek / backtrace.c
Last active June 24, 2016 08:06
backtrace와 addr2line을 이용한 디버깅 방법
#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
/* sig ==> signal number */
void calltrace(int sig)
{
int j, nptrs;
@jybaek
jybaek / bash
Created December 2, 2015 00:15
$@와 $*의 차이 예제코드
#!/bin/sh
echo "================="
echo "\$@ section"
echo "================="
for param in "$@"
do
echo $param,
done