Skip to content

Instantly share code, notes, and snippets.

View prodeveloper0's full-sized avatar
🐱
Meow

Samuel Lee prodeveloper0

🐱
Meow
  • Sounth Korea
View GitHub Profile
@prodeveloper0
prodeveloper0 / divstr.cpp
Created February 18, 2016 16:56
cmd.exe 명령 분할기 구현
#include <iostream>
#include <string>
#include <vector>
//
// 문자열을 구 또는 단어 단위로 분리하는 함수.
//
// str: 분리할 문자열.
// div: 분리된 문자열의 벡터.
//
@prodeveloper0
prodeveloper0 / transfer_over_ssh.cpp
Created April 16, 2016 06:57
Windows는 OpenSSH for Windows 설치가 필요.
#include <stdio.h>
#ifdef WIN32
#define popen _popen
#define pclose _pclose
#endif
FILE *stream = popen("ssh pr0ximo@192.168.2.144 cat /home/pr0ximo/2008.csv", "r");
int main(int argc, char **argv)
@prodeveloper0
prodeveloper0 / remove_androidstudio_osx.sh
Created May 7, 2016 04:03
Remove AndroidStudio from OS X
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*
rm -Rf ~/.gradle
rm -Rf ~/.android
@prodeveloper0
prodeveloper0 / remove_cygwin.cmd
Created May 7, 2016 06:56
Remove Cygwin for Windows
@echo off
"%1\bin\cygrunsrv.exe" -E sshd
"%1\bin\cygrunsrv.exe" -R sshd
takeown /r /d y /f "%1"
icacls "%1" /t /grant Everyone:F
@prodeveloper0
prodeveloper0 / get_cmos_data.c
Created September 19, 2016 06:16
Ring0 권한 필요. CMOS 데이터 가져오기
for(index = 0; index < 128; index++)
{
_asm
{
ov al, index
ut 0x70, al
n al, 0x71
ov tvalue, al
}
}
/* Swift 3.0 UINavigationController 기기 방향 고정 */
extension UINavigationController {
override open var shouldAutorotate: Bool {
return false
}
override open var supportedInterfaceOrientations : UIInterfaceOrientationMask {
return .portrait
}
}
@prodeveloper0
prodeveloper0 / matrix.hpp
Created February 2, 2017 05:31
Image Container for C++
#include <iostream>
#include <vector>
#include <assert.h>
using namespace std;
typedef unsigned short uattr;
typedef unsigned char uchar;
typedef uchar Vec3b[3];
@prodeveloper0
prodeveloper0 / medine4vbefi.sh
Created March 8, 2017 14:00
우분투 VirtualBox에서 NVRAM초기화로 EFI Shell만뜰때 해결법
# at boot: fs0:\efi\ubuntu\grubx64.efi (Enter)
sudo mount /dev/sda1 /mnt
sudo sh -c "echo '\EFI\ubuntu\grubx64.efi' > /mnt/startup.nsh"
sudo umount /mnt
@prodeveloper0
prodeveloper0 / usbwdd.cpp
Created December 5, 2017 05:39
USB Watchdog for Linux
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <errno.h>
#define USBWD_SYN ((unsigned char)0x80)
#define USBWD_ACK ((unsigned char)0x81)
@prodeveloper0
prodeveloper0 / cpuid.cpp
Created January 4, 2018 04:29
How to get x86 compatible processor vendor and brand string using cpuid instruction
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef char MSGBUF[64];
int GetCpuBrandString(MSGBUF dst)
{
unsigned long ul;
unsigned long uls[12] = {0x00};