Skip to content

Instantly share code, notes, and snippets.

View msis's full-sized avatar
Building The Future of Maritime

Mohamed Saad Ibn Seddik msis

Building The Future of Maritime
View GitHub Profile
#!/bin/bash
# Mohamed Saad Ibn Seddik
set -e # exit with nonzero exit code if anything fails
# go to the out directory
cd ${DEPLOY_DIR} || exit 1
# initiate new git repo inside the new deploy folder
git init
@msis
msis / lxc_snap_error_squashfuse.md
Last active February 4, 2018 22:54
[snap on lxc error] Running snap inside a lxc container errors. #lxc #snap #squash #squashfuse

When running snap inside lxc container, snap install might fail with the following output for :

$ systemctl status snap-core-2898.mount
● snap-core-2898.mount - Mount unit for core
   Loaded: loaded (/etc/systemd/system/snap-core-2898.mount; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2017-09-26 15:36:39 UTC; 26s ago
    Where: /snap/core/2898
     What: /var/lib/snapd/snaps/core_2898.snap
@msis
msis / aws_dlami_jupyter.md
Last active February 4, 2018 22:56
[jupyter notebook on AWS] How to launch jupyter notebook from inside AWS Deep Learning AMI? #aws #jupyter #notebook #python #ssh
  1. ssh to the remote instance (based on Ubuntu Deeplearning AMI) with port* redirection:
ssh -L 8888:127.0.0.1:8888 ubuntu@IP
  1. activate the environment (here we're using tensorflow_p36):
source activate tensorflow_p36
  1. launch jupyter:
@msis
msis / ffmpeg_utils.md
Last active February 4, 2018 22:57
[Notes on ffmpeg] #ffmpeg #h264 #fps #mp4

Extract frames from video source

ffmpeg -i myvideo.mp4 -vf fps=4 frm%06d.jpg

Change frame rate of h264 video source

ffmpeg -y -i source.mp4 -r 25 -c:v libx264 -b:v 3M -strict -2 -movflags faststart destination.mp4
@msis
msis / CMakeLists.txt
Last active February 4, 2018 23:03
[Enable range for loop in C++ from CMakeLists.txt] #Cmake #C++ #for
# when using the new C++11 for loops:
# for (auto i : range) {}
target_compile_features(myapp PRIVATE cxx_range_for)
@msis
msis / manual-qt5.conf
Last active February 4, 2018 23:04
[Export manually installed Qt5 libraries] #Qt #LD_LIBRARY_PATH #lib
# To be copied in /etc/ld.so.con.d/
# Manually installed Qt5
/home/big/Qt/5.4/gcc_64/lib
# Do not forget to run ldconfig after to update the cache!
@msis
msis / mount_iso.sh
Last active February 4, 2018 23:04
[Mount iso file Linux] #shell #bash #iso
#!/bin/bah
mount -o loop -t iso9660 file.iso /mnt/test
@msis
msis / exportQt2Cmake.sh
Last active February 4, 2018 23:04
[Use web installed Qt w/ CMake] #bash #env #CMake #Qt
#!/bin/bash
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$HOME/Qt/5.4/gcc_64
@msis
msis / 0Inbox.sh
Last active February 4, 2018 23:05
[0-inbox for Outlook.com with Firefox] #outlook.com #bash #script #shell #firefox
#!/bin/bash
#this script looks for a window named Mozilla Firefox and then starts procedure to select all mails in the current folder and archive them
for i in {1..30}
do
xdotool search --name "Mozilla Firefox" key s+a
xdotool search --name "Mozilla Firefox" key e
sleep 5
done
@msis
msis / export.sh
Last active February 4, 2018 23:07
[update linker library path] When newly installed libraries can't be found by linker #shell #lib #LD_LIBRARY_PATH #export
## Add freshly installed libraries
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib