Category: Linux

  • KRSI – Kernel Runtime Security Instrumentation

    KRSI (appeared in Kernel v5.7) stands for Kernel Runtime Security Instrumentation and the target of this patch is to allow users to implement lsm hooks by utilizing bpf compiled code. This gets interesting for a couple of reasons: LSM ENABLE KRSI BOOT PARAMETER Check current boot parameter cat /proc/cmdline Edit the boot parameters sudo vim…

  • [visudo] Username is not in the sudoers file

    Username is not in the sudoers file. This incident will be reported Besides making sure that your username is in sudo group (I think it is), there are other cases that cause this problem. Some of them may have something to do with sudoers file (/etc/sudoers) in my case, i accidently commented out 1 important…

  • Tùy biến Terminal bằng oh-my-zsh & powerlevel10k

    Bước 1: cài đặt zsh Bước 2: cài đặt oh-my-zsh Bước 3: cài đặt powerlevel10k (click for full tutorial) Open ~/.zshrc, find the line that sets ZSH_THEME, and change its value to “powerlevel10k/powerlevel10k” Done. Bước 4: Cài đặt và cấu hình antigen (optional) 4.1 Tạo file ~/.antigenrc và thêm plugins 4.2 Cấu hình ~/.zshrc (để kích hoạt antigen)…

  • Applied Machine Learning – things you need to know

    Một số lưu ý khi áp dụng Machine Learning để giải quyết các vấn đề cụ thể: Always use train_test_split or similar GridSearchCV (built-in cross validation) HDF need to be shrunk after write/update –> ptrepack –chunkshape=auto –propindexes –complevel=9 –complib=blosc data_in.h5 data_out.h5 Use Keras optimizer instead of tensorflow itself (so that it can be saved later…

  • Bash: check if a zip or a rar file has password-protection

    ZIP crypted=$( 7z l -slt — $file | grep -i -c “Encrypted = +” ) if [ “$crypted” -eq “1” ]; then protected=1 fi RAR unrar x -p- -y -o+ “$file” 1> /dev/null 2> /dev/null if [ “$?” -eq “3” ] ; then unrar x -p$password -y -o+ “$file” 1> /dev/null 2> /dev/null fi Source:…

  • Linux Tips

    bash (zsh too) tricks from tutorialLinux sudo !!: re-run previous command in sudo prepended ctrl-k ctrl-u ctrl-w ctrl-y cutting/pasting text less +F /  less then shift-f instead of tail ctrl-x-e to continue editting shell in a text editor alt-. to paste previous command’s argument reset to reset/unbork your terminal ctrl-a. ctrl-e to move to the…

  • Koding : coding in the Cloud

    https://koding.com [just calm down and move on, it’s gonna save your time later, trust me] This one is new to me so I’m going to have a brief introduction here, hopefully it’s worth your time reading this : 1. The first thing is an active support from the Community & Administrators : My question was answered…

  • Hadoop 2.2 Single Node Installation on CentOS 6.5

    By far the best tutorial for you to get started with Hadoop installation. Source : http://alanxelsys.com/2014/02/01/hadoop-2-2-single-node-installation-on-centos-6-5/ Introduction This HOWTO covers Hadoop 2.2 installation with CentOS 6.5. My series of tutorials are meant just as that – tutorials. The intent is to allow the user to gain familiarity with the application and should not be construed…

  • A little bit of Python, FTP and CentOS

    Today I will approach the system using few lines of Python code : – Python code : FTP client – CentOS server :  FTP server Let’s get started ! FTP uses 2 port : 21 and (sometimes) 20 if the server is in active mode – or a random port (we’ll see them in this…

  • Python setup tools easy_install Linux

    Let’s not use easy_install anyway: https://packaging.python.org/discussions/pip-vs-easy-install/ https://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install Cai dat easy_install cho linux, unix : I ran into a bit of trouble installing easy_install, after reading many useless articles, this is how I solved the problem,  actually it’s rather simple : Type : wget https://bitbucket.org/pypa/setuptools/downloads/ez_setup.py && python ez_setup.py and you’re done .   Bonus : to…