Skip to content

Instantly share code, notes, and snippets.

@charsyam
charsyam / bash
Created September 9, 2019 16:27
pyenv_init.sh
#!/bin/bash
SHELLRC=~/.bash_profile
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> $SHELLRC
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> $SHELLRC
echo 'eval "$(pyenv init -)"' >> $SHELLRC
git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
@charsyam
charsyam / hash.c
Created August 26, 2019 09:26
Hafl MD4 hash from linux/fs/ext/hash.c
// SPDX-License-Identifier: GPL-2.0
/*
* linux/fs/ext4/hash.c
*
* Copyright (C) 2002 by Theodore Ts'o
*/
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdint.h>
#include <inttypes.h>
#include <immintrin.h>
#include <omp.h>
Received-SPF: none (mx.naver.com: domain of [email protected] does not designate permitted sender hosts)
client-ip=108.166.43.104; x-iptype=white;
Authentication-Results: mx.naver.com;
spf=none (mx.naver.com: domain of [email protected] does not designate permitted sender hosts) [email protected]
X-Naver-ESV: +9eYpB3G1H+Yp6lTWNmRKAvmFAgrjJ+Y
X-Session-IP: 108.166.43.104
Received: from smtp104.ord1c.emailsrvr.com (smtp104.ord1c.emailsrvr.com [108.166.43.104])
by crcvmail12.nm.naver.com with ESMTP id ZYf9otdSSiqg5dsoO2Q4Bg
for <[email protected]>;
Wed, 22 Aug 2018 09:04:06 -0000
import sys
import struct
def read_sectors(fd, sector, count = 1):
fd.seek(sector * 512)
return fd.read(count * 512)
def print_table_entry(table):
print("=======================================")
print("Active: ", table[0])
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
public class ConvertNumberToDollar {
public static String convertNumberToDollar(String input) {
String output = "";
for (int i = 0; i < input.length(); i++) {
char ch = input.charAt(i);
if (ch >= '0' && ch <= '9') {
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.io.FileWriter;
class User {
private String name;
private String email;
public User(String name, String email) {
import java.io.FileReader;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Map;
import java.util.Map.Entry;
import java.util.HashMap;
import java.util.Scanner;
class User {
public class Test {
public static boolean endsWith(String src, String postfix) {
if (src.length() < postfix.length()) {
return false;
}
for (int i = 0; i < postfix.length(); i++) {
int idx = src.length() - postfix.length() + i;
char ch1 = src.charAt(idx);
char ch2 = postfix.charAt(i);
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
public class SumNumber {
public static void main(String [] args) {
Scanner sc = new Scanner(System.in);
List<Integer> values = new ArrayList<Integer>();