Skip to content

Instantly share code, notes, and snippets.

View zkylab's full-sized avatar
🎯
Focusing

Çağatay Şama zkylab

🎯
Focusing
View GitHub Profile
@zkylab
zkylab / q5.c
Last active February 6, 2021 18:49
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#define NUM_OF_THREAD 10
static int res = 0;
int checkIsItPrime(int n) {
int i, flag = 0;
for (i = 2; i <= n / 2; ++i) {
# mails_raw.txt ==> Ken Thomson 555 1234567 ken0[at]thomson.com ... etc.
input="mails_raw.txt"
regex="(\w{1,})\[at\](\w{1,}\.\w{1,})"
while IFS= read -r line
do
while [[ $line =~ $regex ]]; do
echo "${BASH_REMATCH[1]}@${BASH_REMATCH[2]}" >> mail.txt
line=${line#*"${BASH_REMATCH[1]}"}
done
done < "$input"
# usage : sudo bash archiveMaster.sh
today=$(date +"%Y-%m-%d")
archiveFileName="$(whoami)_home_$today.tgz"
tar -cvzf $archiveFileName /home/*
archiveCounterCommand="tar -tzf $archiveFileName | wc -l"
archiveFileCounter=$(eval "$archiveCounterCommand")
homeFileCounterCommand="find /home/* | wc -l"
homeFileCounter=$(eval "$homeFileCounterCommand")
echo $homeFileCounter . "and" . $archiveFileCounter
if [[ $homeFileCounter -eq $archiveFileCounter ]]
@zkylab
zkylab / pass.txt
Last active August 11, 2020 11:46
bizzy
root:dFexQ
ankara
biznet 10.0.0.1 hacked by çağatay root 1234
@zkylab
zkylab / reflect.java
Created June 19, 2017 21:49
reflection
import java.lang.reflect.Method;
public class Demo {
public static void main(String[] args) {
Class ornekSinif = OrnekSinif.class;
Method[] methods = ornekSinif.getDeclaredMethods();
for (int i = 0; i < methods.length; i++){
System.out.println(methods[i].toString());
}
}