Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, October 14, 2019

Mini Automation Project 2

Almost five years ago I have developed a mini automation project for automating turning things on and off at certain times. This project can be found here: http://www.etedal.net/2014/01/mini-automation-project.html

I have done a very similar project using BeagleBone and Python which the related code can be found here:
https://github.com/mahyaret/MiniAutomation

Sunday, September 29, 2019

Raspberry Pi 4 as a HiFi Music Server

I've bought Raspberry Pi 4 to use it as a DaaS (Desktop as a Service). I've needed a VPN server to securely connect to when I am traveling. I've needed a Cloud Server to replace Dropbox to have unlimited space. I've needed a NAS (Network-attached storage) to share files among my laptops and computers. I've also needed a Music Player Server to manage my music files and serve as a source for my amplifier. I've also needed a media player like Apple TV to play my movies, youtube etc.

Note: the sound quality was not satisfying for me.

In summary Raspberry Pi as:
1. Cloud server
2. VPN server
3. NAS
4. Music server (this post) (not recommended)
5. Media Player

Saturday, September 28, 2019

Raspberry Pi 4 as a Media Player

I've bought Raspberry Pi 4 to use it as a DaaS (Desktop as a Service). I've needed a VPN server to securely connect to when I am traveling. I've needed a Cloud Server to replace Dropbox to have unlimited space. I've needed a NAS (Network-attached storage) to share files among my laptops and computers. I've also needed a Music Player Server to manage my music files and serve as a source for my amplifier. I've also needed a media player like Apple TV to play my movies, youtube etc.

In summary Raspberry Pi as:
1. Cloud server
2. VPN server
3. NAS
4. Music server
5. Media Player (current post)

Raspberry Pi 4 as a NAS

I've bought Raspberry Pi 4 to use it as a DaaS (Desktop as a Service). I've needed a VPN server to securely connect to when I am traveling. I've needed a Cloud Server to replace Dropbox to have unlimited space. I've needed a NAS (Network-attached storage) to share files among my laptops and computers. I've also needed a Music Player Server to manage my music files and serve as a source for my amplifier. I've also needed a media player like Apple TV to play my movies, youtube etc.

In summary Raspberry Pi as:
1. Cloud server
2. VPN server
3. NAS (this post)
4. Music server
5. Media Player

Raspberry Pi 4 as a VPN Server

I've bought Raspberry Pi 4 to use it as a DaaS (Desktop as a Service). I've needed a VPN server to securely connect to when I am traveling. I've needed a Cloud Server to replace Dropbox to have unlimited space. I've needed a NAS (Network-attached storage) to share files among my laptops and computers. I've also needed a Music Player Server to manage my music files and serve as a source for my amplifier. I've also needed a media player like Apple TV to play my movies, youtube etc.

In summary Raspberry Pi as:
1. Cloud server
2. VPN server (this post)
3. NAS
4. Music server
5. Media Player

Raspberry Pi 4 as a Cloud Server

I've bought Raspberry Pi 4 to use it as a DaaS (Desktop as a Service). I've needed a VPN server to securely connect to when I am traveling. I've needed a Cloud Server to replace Dropbox to have unlimited space. I've needed a NAS (Network-attached storage) to share files among my laptops and computers. I've also needed a Music Player Server to manage my music files and serve as a source for my amplifier. I've also needed a media player like Apple TV to play my movies, youtube etc.

In summary Raspberry Pi as:
1. Cloud server (this post)
2. VPN server
3. NAS
4. Music server
5. Media Player

Friday, September 20, 2019

Create a Bootable Windows 7 or 10 USB Drive in Linux

source: https://thornelabs.net/posts/create-a-bootable-windows-7-or-10-usb-drive-in-linux.html


# fdisk /dev/sdY

create single partition type 7+bootable partition

# mkfs.ntfs -f /dev/sdY1
# ms-sys -7 /dev/sdY

# mount -o loop win7.iso /mnt/iso
# mount /dev/sdY1 /mnt/usb
# cp -r /mnt/iso/* /mnt/usb/

Monday, April 8, 2019

Mosh

Mosh is similar to SSH, remote terminal application but it allows roaming, and supports intermittent connectivity. Its usage is similar to SSH. It has to be installed both on the server and client.

On RedHat/CentOS remote server:

sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

sudo yum install mosh

sudo firewall-cmd --zone=public --permanent --add-port=60000-61000/udp

sudo firewall-cmd --reload

Azure:

If you're using Azure, make sure to allow the inbound port:



On local Mac:

brew install mosh

Sunday, April 7, 2019

How to recover a shell after a disconnection?


It is not possible! but the cure is tmux. I start tmux, start the operation and go on my way. If I return and find the connection has been broken, all I have to do is reconnect and type tmux attach

For installing tmux on Mac:
   brew install tmux
tmux in the top image is running with vtop on the top pane and PM2 on the bottom.
Here is the cheatsheet for tmux:

Saturday, March 23, 2019

Use Azure as your Jupyter notebook Server

Make sure to follow the steps from this post to setup your Azure Virtual Machine:
http://www.etedal.net/2019/03/setting-up-azure-nc6-for-kaggle.html

Setup Jupyter remote ssh connection:
On Azure: jupyter notebook --no-browser --port=2001
On your machine: ssh -N -f -L localhost:2002:localhost:2001 remoteuser@remotehost
(Optional if you use mosh instead): mosh -ssh "ssh -N -f -L localhost:2002:localhost:2001" remoteuser@remotehost
On your browser: localhost:2002

Wednesday, March 13, 2019

Windows Subsystem for Debian

If you're frustrated using Windows and there is no way around not using it use the following:
https://docs.microsoft.com/en-us/windows/wsl/install-win10

Open PowerShell as Administrator:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Install Debian:
https://www.microsoft.com/en-ca/p/debian/9msvkqc78pk6?rtc=1&activetab=pivot:overviewtab

sudo apt update

Thursday, March 7, 2019

Google Test (gtest) on Debian

Here is the link to the project source https://github.com/google/googletest

Here is the code for installing Google Test (gtest)

Monday, November 5, 2018

Common Lisp IDE

Best resource for Common Lisp can be found here: https://github.com/norvig/paip-lisp

Emacs

- sudo apt-get install emacs
 
SBCL

- Download from here: http://www.sbcl.org/platform-table.html
- sudo ./install.sh

Slime

- create .emacs  in your home folder.

Sunday, October 21, 2018

Skype problem with Camera in Linux

Suppose your webcam is in /dev/video0.


1. sudo apt-get install v4l2loopback-dkms

2. sudo modprobe v4l2loopback

3. Finally, when you need your webcam on Skype, just run this command:

    ffmpeg -i /dev/video0 -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video1

Tuesday, December 22, 2015

How to Setup a VPN (PPTP) Server on Debian Linux

1:
 
sudo apt-get install pptpd
 
2:
 
sudo nano /etc/pptpd.conf
 
3: Add server IP and client IP at the end of the file. You can add like below:
 
 localip 192.168.2.100
remoteip 192.168.2.101-200
 
localip is the ip address of the server in the network and remoteip is the range you specify for vpn clients to join your network.

Monday, December 21, 2015

How to settup HTTP Proxy server in Ubuntu

Squid - Proxy Server

Squid is a full-featured web proxy cache server application which provides proxy and cache services for Hyper Text Transport Protocol (HTTP), File Transfer Protocol (FTP), and other popular network protocols. Squid can implement caching and proxying of Secure Sockets Layer (SSL) requests and caching of Domain Name Server (DNS) lookups, and perform transparent caching. Squid also supports a wide variety of caching protocols, such as Internet Cache Protocol (ICP), the Hyper Text Caching Protocol (HTCP), the Cache Array Routing Protocol (CARP), and the Web Cache Coordination Protocol (WCCP).
The Squid proxy cache server is an excellent solution to a variety of proxy and caching server needs, and scales from the branch office to enterprise level networks while providing extensive, granular access control mechanisms, and monitoring of critical parameters via the Simple Network Management Protocol (SNMP). When selecting a computer system for use as a dedicated Squid caching proxy server for many users ensure it is configured with a large amount of physical memory as Squid maintains an in-memory cache for increased performance. 

Saturday, July 18, 2015

How to set up a personal home web server (100% free)

First step is assigning a globally known address to your home network. Remote access via Dynamic DNS makes this possible. There are many websites provide such service. I have used http://www.noip.com because my internet modem/router supports this website! You have to register in noip website and then you have to add a Host (DNS Host (A)).

Next thing is configuring your modem/router for updating the website with your Dynamic Valid IP address. For doing this you have to find DDNS (Dynamic DNS) under Network settings and enter your noip account details.

For security reason you still cannot access you computers via internet. For doing this you have to use DMZ service. First assign a static IP address for the computer that you want to use it as the  server (e.g. 192.168.2.100). Then add this IP address as DMZ device.

Now you have a connected server. You can now install LAMP or WAMP.

Monday, June 29, 2015

How to install GraspIt!

GraspIt! was created to serve as a tool for grasping research. It is a simulator that can accommodate arbitrary hand and robot designs. It can also load objects and obstacles of arbitrary geometry to populate a complete simulation world. The GraspIt! engine includes a rapid collision detection and contact determination system that allows a user to interactively manipulate a robot or an object and create contacts between them. Once a grasp is created, one of the key features of the simulator is the set of grasp quality metrics. Each grasp is evaluated with numeric quality measures, and visualization methods allow the user to see the weak point of the grasp and create arbitrary 3D projections of the 6D grasp wrench space. Here is the website: http://www.cs.columbia.edu/~cmatei/graspit/

If you are running Ubuntu 12 you can use this precompiled version: https://drive.google.com/file/d/0B7S255p3kFXNSmFLREd6dWdDOVk/view?pli=1

Tuesday, June 10, 2014

Triple Boot on MacBookPro Retina

If you want to have Windows and Ubuntu alongside your Mac OS on your MacBookPro you should be aware of the followings:
The only Linux distribution which has a built-in support for Mac hardware is Ubuntu. For example after installing Fedora in addition to resolution problem your wireless network card won't work initially.
According to my experience you should first install Windows and then Linux. In order to install Windows it is better to use the Apple Boot Camp which automatically downloads and attache software and drivers to the Windows image and makes a bootable Windows USB for you.
By using Disk Utility a exFAT partition for Windows and keep the remaining as free space for Linux.
If you want just Windows alongside Mac you can restart your mac then press "option" key and then install Windows. However this doesn't work fork triple scenario then you need to install another program called "rEFInd".