Skip to content

Instantly share code, notes, and snippets.

View kittinan's full-sized avatar
🇹🇭
|||

Kittinan kittinan

🇹🇭
|||
View GitHub Profile
@kittinan
kittinan / fix_tensorflow.md
Created July 11, 2020 17:26
Fix Failed to get convolution algorithm.

Fix Tensorflow 2.X Keras Error

If you install correct Tensorflow, cuDNN and CUDA Toolkit version and got this error message.

Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.

Try to Add this code below before import your tensorflow

@kittinan
kittinan / create_swap.sh
Created April 20, 2020 07:07
Ubuntu 18.04 create swap
#!/bin/bash
# Run as root
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
sysctl vm.swappiness=10
echo "vm.swappiness=10" >> /etc/sysctl.conf
stages:
- build
- deploy
build:
stage: build
when: on_success
only:
- master
image: docker:stable
@kittinan
kittinan / frida.md
Created April 11, 2020 08:02
frida ssl pinning bypass ubuntu 18.04

Frida SSL Pinning Bypass for Ubuntu 18.04 and Android

Requirement

  • Android rooted device with Magisk
  • Android Magisk install MagiskFrida module
  • Ubuntu 18.04

Android

  • Install MagiskFrida module
@kittinan
kittinan / .bashrc
Created June 17, 2019 02:28
auto activate virtualenv when enter to folder has venv folder
function cd() {
builtin cd "$@"
if [[ -z "$VIRTUAL_ENV" ]] ; then
## If env folder is found then activate the vitualenv
if [[ -d ./venv ]] ; then
source ./venv/bin/activate
fi
else
## check the current folder belong to earlier VIRTUAL_ENV folder
@kittinan
kittinan / nginx.conf
Last active February 22, 2023 02:37
phpmyadmin nginx /etc/phpmyadmin/nginx.conf
location /phpmy/ {
alias /usr/share/phpmyadmin/;
index index.php;
}
location ~ ^/phpmy/(.*\.(js|css|gif|jpg|png))$ {
alias /usr/share/phpmyadmin/$1;
}
location ~ ^/phpmy(.+\.php)$ {
@kittinan
kittinan / line-notify.sh
Created November 30, 2018 09:51
shell script line notify
#!/bin/bash
msg="message=$1"
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer TOKEN" \
--data "$msg" \
https://notify-api.line.me/api/notify
@kittinan
kittinan / conv_autoencoder_keras.ipynb
Created September 11, 2018 16:27 — forked from naotokui/conv_autoencoder_keras.ipynb
Convolutional Autoencoder in Keras
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kittinan
kittinan / reload_module.py
Created August 24, 2018 07:08
Jupyter notebook auto reload module
%load_ext autoreload
%autoreload 2
%reload_ext autoreload
@kittinan
kittinan / rename_bulk.sh
Created August 15, 2018 02:57
shell script add prefix to file
#!/bin/bash
for f in * ; do mv -- "$f" "PRE_$f" ; done