Skip to content

Instantly share code, notes, and snippets.

:octocat:
Be yourself. Be now!

Sanzhar Askaruly tuttelikz

:octocat:
Be yourself. Be now!
Block or report user

Report or block tuttelikz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tuttelikz
tuttelikz / bilateral_filter.m
Created May 6, 2017
Bilateral Filter - MATLAB
View bilateral_filter.m
clc, close all, clear all;
img = imread('puppy.jpg');
A = rgb2gray(img);
[m,n] = size(A);
%Filter Parameters setup
windowSize = input('Enter window size (3/5/7):\n ');
stDevSpace = input('Enter space standard deviation (1-20):\n ');
@tuttelikz
tuttelikz / Rename_files.txt
Created Jan 4, 2018
Rename filename bash
View Rename_files.txt
num=0; for i in *; do mv "$i" "$(printf '%04d' $num).${i#*.}"; ((num++)); done
@tuttelikz
tuttelikz / add_prefix_to_filename.txt
Created Jan 18, 2018
Bash command for adding prefix
View add_prefix_to_filename.txt
for f in * ; do mv "$f" "PRE_$f" ; done
@tuttelikz
tuttelikz / write_labels_tofile.py
Created Jan 18, 2018
This is a python script to write list characters into file
View write_labels_tofile.py
thefile = open('train_test_data_labels.txt', 'w')
for item in y_train_test_list:
thefile.write("%s\n" % item)
@tuttelikz
tuttelikz / read_labels_fromfile.py
Created Jan 18, 2018
This is a simple script to read labels from file
View read_labels_fromfile.py
array = []
with open('train_test_data_labels.txt') as fileobj:
for line in fileobj:
for ch in line:
array.append(ch)
#print(ch)
new_list = [a for a in array if a != '\n']
@tuttelikz
tuttelikz / copy_folders_without_contents
Created Jan 20, 2018
This is a bash command on windows to copy folders structure without contents
View copy_folders_without_contents
xcopy C:\Folders D:\Folders /t /e
View copy_to_remote_windows
# After installation of PuTTY, open command window prompt and type the following:
//For copying folder:
pscp -r source destination
//For copying file:
pscp source destination
@tuttelikz
tuttelikz / run_multiple_script_command
Created Jan 20, 2018
For running multiple bash commands
View run_multiple_script_command
#This is an example how to run multiple bash commands together
# Just put && symbol between commands
cd o_cheek/ && num=0; for i in *; do mv "$i" "$(printf 'cheek_old_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv o_cheek cheek_old && cd o_eye/ && num=0; for i in *; do mv "$i" "$(printf 'eye_old_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv o_eye eye_old && cd o_forearm/ && num=0; for i in *; do mv "$i" "$(printf 'forearm_old_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv o_forearm forearm_old && cd y_cheek/ && num=0; for i in *; do mv "$i" "$(printf 'cheek_young_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv y_cheek cheek_young && cd y_eye/ && num=0; for i in *; do mv "$i" "$(printf 'eye_young_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv y_eye eye_young && cd y_forearm/ && num=0; for i in *; do mv "$i" "$(printf 'forearm_young_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv y_forearm forearm_young
@tuttelikz
tuttelikz / move_certain_files
Created Jan 20, 2018
Bash command to move files with certain extension
View move_certain_files
mv /path/to/original/directory/*.pdf /path/to/new/directory
@tuttelikz
tuttelikz / count_files
Created Jan 20, 2018
Bash script to count number of files
View count_files
find . -type f | wc -l
You can’t perform that action at this time.