Sunday, October 15, 2023

create rc.local on systemd

 vi /etc/systemd/system/rc-local.service

 [Unit]
Description=/etc/rc.local
ConditionPathExists=/etc/rc.local

[Service]
#Type=forking
Type=idle
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target

vi /etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0

chmod a+x /etc/rc.local

 sudo systemctl enable rc-local.service

done!



Thursday, October 12, 2023

samba share folder

 To share samba (windows share) with all permisson (on debian jessie) add following lines to  /etc/samba/smb.conf

...

[<name media>]
 path = <path to folder>
 public = yes
 writable = yes
 comment = smb share
 printable = no
 guest ok = yes
 read only = no
 directory mask = 0775

example:

vi /etc/samba/smb.conf

.....

[media]
 path = /media
 public = yes
 writable = yes
 comment = smb share
 printable = no
 guest ok = yes
 read only = no
 directory mask = 0775


to add password simple:

[media]
 path = /media
 public = yes
 writable = yes
 comment = smb share
 printable = no
 guest ok = no
 read only = no
 directory mask = 0775
 username = igunos

multiple user  username = igunos, jony, antony

then add password

sudo smbpasswd -a igunos

....<your passwd>

 

client:

mount via cifs-utils

sudo mount -t cifs //10.1.1.60/media/ /mnt -o username=<your_username>,password=<your_password


nfs share folder

To share nfs with all permission add these line to /etc/exports (on debian jesssie)

<folder> <ip/mask>  (rw,sync,no_subtree_check,no_all_squash,no_root_squash) 

to be accessedon multiple subnet

<folder> <ip/mask>  (rw,sync,no_subtree_check,no_all_squash,no_root_squash)  <ip2/mask> (rw,sync,no_subtree_check,no_all_squash,no_root_squash) 

 

examples:

 vi /etc/exports

....

 /media/data 10.1.1.0/255.255.255.0(rw,sync,no_subtree_check,no_all_squash,no_root_squash) 

/media/maindata 10.1.1.0/255.255.255.0(rw,sync,no_subtree_check,no_all_squash,no_root_squash) 10.1.2.0/255.255.255.0(rw,sync,no_subtree_check,no_all_squash,no_root_squash)

client

mount  -t nfs 10.1.1.60:/media/<dir> /mnt 

if passwored

mount  -t nfs 10.1.1.60:/media/<dir> /mnt -o username=<user>,password=<pass>


Wednesday, October 5, 2022

Public Announcement system using Asterisk

I got a task to build a Public Announcement system with select able address, single or multi destination. Here I'm using asterisk void server using few banana-pi board that i got from rejected defect board on my last project, but still functional.


 

Sunday, April 17, 2016

Github Cheatsheet

Set global users

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com

create a new repository on the command line

echo "# apcombo" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/huntu2/apcombo.git
git push -u origin master

or push an existing repository from the command line

git remote add origin https://github.com/huntu2/apcombo.git
git push -u origin master

or import code from another repository

You can initialize this repository with code from a Subversion, Mercurial, or TFS project.