Skip to main content

Posts

Showing posts with the label Ubuntu

Ubuntu simple avoid bash history by extra space at the command beginning

I randomly found that with extra space at the beginning of command, bash shell do not record its history. nickfarrow :dev$ echo "Test history" #space at beginning Test history nickfarrow :dev$  echo "test history #2" test history #2 nickfarrow :dev$   echo "test history #3" test history #3 $ history => only show first command without extra space 2215  echo "Test history" And when use UP key  ↑, it only show command without extra space. I am using Ubuntu 18 (VirtualBox) nickfarrow :dev$ uname -a Linux nickfarrow-VirtualBox 5.4.0-120-generic #136~18.04.1-Ubuntu SMP Fri Jun 10 18:00:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Slow Ubuntu boot time caused by service - this case php7.2-fpm

1min 2.221s phpsessionclean.service          59.989s apt-daily.service          18.665s ModemManager.service          17.564s php7.2-fpm.service https://superuser.com/questions/1323790/phpsessionclean-service-causes-long-boot-time-in-debian-sid sudo systemctl disable php7.2-fpm.service https://unix.stackexchange.com/questions/315502/how-to-disable-apt-daily-service-on-ubuntu-cloud-vm-image https://itsfoss.com/how-to-fix-system-program-problem-detected-ubuntu/ sudo journalctl --boot oh apport report is required in order to make system boot success (done).

Ubuntu Server Mail

Some notes when setting ubuntu mail server: guides: 1. Main guide post: https://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql 2. other post to understand types and how to setting mail server: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-14-04 http://askubuntu.com/questions/47609/how-to-have-my-php-send-mail List popular MTA and MDA on ubuntu: https://help.ubuntu.com/community/MailServer Automatic tool on github https://github.com/mail-in-a-box Steps: Install postfix (MTA - mail transfer agent) dovecot (a simple MDA - mail deliver agent) sudo apt-get install libsasl2-2 libsasl2-modules sasl2-bin :) Here I'm simulate funny message when King Philip II of Macedon to Thrace: "If I win this war, you will be slaves forever." And You (Thrace) will reply: "If" PHP requires an SMTP client to send mail. You could install a full-featu...

Cài PAE cho nhân linux

Linux bản 32bit như các bạn đã biết chỉ nhận tối đa cỡ 3GB RAM. Muốn dùng hơn người ta hay cài PAE vào nhân hay cài bản 64bit. Tuy nhiên bản 64bit hiện giờ có hạn chế là có phần mềm không tương thích ... Các bạn làm theo hướng dẫn sau để enable HIGHMEM64G cho linux. enabling-pae-on-a-32-bit-ubuntu-desktop-supporting-up-to-64-gb/ Một số lưu ý: - Dịch lại nhân linux khá mất thời gian, máy mình core i5 đời cũ, 4GB Ram chạy mất 1h cho stage 1, stage 2 mất tầm 30'. - Sau khi dịch ra 2 gói .deb 1 header và 1 image các bạn cài gói image trước thay vì gói header như trong hướng dẫn nếu gặp lỗi đòi header. Ram 4GB hiện giờ cỡ 900k. Đa số lap bây giờ là 4GB = 2x2GB. Cài xong kernel mới các bạn nhớ xóa source đi cho nhẹ, của mình bản 3.2.0-57 là 6GB. Chúc thành công !

FFmpeg and Imagick

Ghép mặt người vào 1 video cụ thể. Có nhiều trang như  http://www.jibjab.com/ cho phép người dùng đưa mặt mình vào một số video ngộ nghĩnh như rockstar, dance video ... Thậm chí bạn có thể thêm nhiều mặt người vào video để thành cặp hay nhóm. Kỹ thuật làm trang này chủ yếu dựa trên Flash, chi tiết có thể tra GG. Mình muốn giới thiệu một cách khác không dùng Flash và có thể chạy trên mọi thiết bị thông qua web.  Về kỹ thuật video ghép từ nhiều khung hình, thường là 25fps (frames per second, hay video nhanh hơn là 30fps. Do vậy, chỉ cần ghép mặt mình vào từng khung hình hoặc đè lên theo từng thời điểm là OK. Công cụ đã có sẵn FFmpeg ghép ảnh thành video, ImageMagick chỉnh sửa ảnh cơ bản. Và một Tool quan trọng đó là  Adobe AfterEffect (AE) trong bộ Adobe Suites. Tool này chuyên để chỉnh sửa video. Nó có 1 chức năng là Motion Tracking detect vật thể di chuyển theo khung hình. Như vậy là về kỹ thuật là có thể làm được, kết quả vd: https://drive.google.com/file/d/0...