Skip to main content

Developer tools, tricks

 Developer Tips

------------ create cscope and tags to source code --------------

Create CTAGS, CREATE FILE LIST [cscope.files], start cscope where the cscope.file exist.

cscope steps - ctags -R . ; find . -name *.[CchH] > cscope.files ; cscope # ready to start using cscope.


Using Ctrl+] Ctril+T for moving forward/ backwards.

----------------------------------------------------------

Setting up messages file log rotation on linux

1. # su - $ change to root account

2. # go to /etc/logrotate.d

   # delete the line (/var/log/messages) from file syslog

sed "/message/d" /etc/logrotate.d/syslog > /tmp/tmpsyslog && mv /tmp/tmpsyslog /etc/logrotate.d/syslog OR

grep -v "message" /etc/logrotate.d/syslog > /tmp/tmpsyslog && mv /tmp/tmpsyslog /etc/logrotate.d/syslog

3. #create new file and add below content to limit the file rotate on 20M file size or weekly once which is satisfied

cat <<EOF > /etc/logrotate.d/messageslog

/var/log/messages

{

    weekly

    rotate 13

    size 20M

    missingok

    dateext

    dateformat -%Y%m%d-%s

    notifempty

}

EOF


4. #Make entry to file /etc/cron.d/0hourly - run the logrotate for messages every 4 hrs at 2 min time

02 */4 * * * root logrotate /etc/logrotate.d/messageslog

OR

add above entry to crontab using command

crontab -e


to run the script at 5th min of each hour

05 * * * * root logrotate /etc/logrotate.d/messageslog


For running every few seconds (running lesser than 1 min duration) As the cron allows the granularity set upto 1 min only, below is the example to run the log rotation every 30 sec (2 times) or 15 secs (3 times)

* * * * * root logrotate /etc/logrotate.d/messageslog && sleep 30; logrotate /etc/logrotate.d/messageslog

* * * * * root for i in 0 1 2; do logrotate /etc/logrotate.d/messageslog & sleep 15; done;

-----------------------------

# script to fill up the messages file under /var/log folder

create a file with 777 permissions in /tmp

touch /tmp/nonstop.txt

# execute logger command to start dumping content of this file into the /var/log/messages file

logger -f /tmp/nonstop.txt


# run the script to write into /tmp/nonstop.txt file

test it by executing - sudo echo "Hello Test" > /tmp/nonstop.txt

================notstop.sh START ================

#!/bin/bash

counter=0

while true

do

sudo echo "$counter - testing non stop logs to messages file" >  /tmp/nonstop.txt

counter=$(( counter + 1 ))

sleep 1

# -n option, omits the new line after echo

echo -n '.'

done

================notstop.sh END================

linux kernel source

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/net/ipv4/tcp_input.c?h=linux-4.0.y

file - /net/ipv4/tcp_input.c

RFC - https://tools.ietf.org/html/rfc5827#section-3

https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt

-----------------------------


Comments

Popular posts from this blog

NSSF - an 5G network function to support the network slicing

NSSF - Network Slice Selector Function The 5G System architecture (3GPP TS 23.501: 5G SA; Stage 2) consists of the following network functions (NF). - Authentication Server Function (AUSF) - Core Access and Mobility Management Function (AMF) - Data network (DN), e.g. operator services, Internet access or 3rd party services - Structured Data Storage network function (SDSF) - Unstructured Data Storage network function (UDSF) - Network Exposure Function (NEF) - NF Repository Function (NRF) - Network Slice Selection Function (NSSF) ======>>> our focus - Policy Control function (PCF) - Session Management Function (SMF) - Unified Data Management (UDM) - Unified Data Repository (UDR) - User plane Function (UPF) - Application Function (AF) - User Equipment (UE) - (Radio) Access Network ((R)AN)

SMS-SG on LTE/ MTC networks

SMS with LTE  (SG-SMS) SMS (Short Messaging Service) was quite popular among people during 2G/3G, but now with the advent of 4G losing the shine/ attraction. With 4G people are moving to always-on kind of data connectivity and thus market rising with many application options to provide the messaging capabilities. The examples are such as whatsapp, snapchat etc Now here we are going to discuss, “can an SMS possible in LTE technology ?” and if so “how?” One possibility of using IMS framework and delivering SMS to/from UE. IMS provides the data (e.g. data, media-voice/video) usage overlaid on LTE technology. The bigger question and climax is on market pace in adapting and deployment of the IMS. To address the feature availability, an interim solution (SG interfaces) are suggested in specs. (its similar on the lines on how CS fallback option before LTE supporting Voice calls) Lets revisit the past (2G) on how SMS are delivered. SMS is delivered over signaling channel. This me

Cloud based Frameworks/ Kubernetes environment

Cloud based microservice frameworks Some of open source platforms available are Swarm (Docker), Kubernetes (google), mesos, The most popular in communities and internet industry seems to be kubernetes and picking steam in telecom front as well for upcoming 5G Service based architecture. The kubernetes has the default container solution based on Rket ? but the most popular combinations are using Docker as container. Kubernetes/ an Cloud orachastrator !! Deployment automation of scaling in (zooming in/ increasing) and out (zooming out, decreasing) Network plugin available such as flannel (popular, support only IPv4), calico (support IPv4, IPv6), weavenet Kubernetes currently does not support dual stack IPv4, IPv6 inter-working etc capabilities till version 1.13 (dec 2018). Another limitation, it does not recognize the multiple interfaces in case enable to POD's for configuring services exposure and external communication till version 1.13 (dec 2018) Will be adding more