Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Çağatay Şama zkylab

🎯
Focusing
  • Trendyol
  • İstanbul
  • Twitter @zkylab
View GitHub Profile
View q5.c
#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) {
View mailer.sh
# 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"
View archiveMaster.sh
# 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 ]]
View pass.txt
bizzy
root:dFexQ
ankara
View rootz.dat
biznet 10.0.0.1 hacked by çağatay root 1234
View reflect.java
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());
}
}