Skip to content

Instantly share code, notes, and snippets.

View danish-rehman's full-sized avatar

danish-rehman

View GitHub Profile
@danish-rehman
danish-rehman / check_queue_size
Created January 8, 2015 08:13
Check NIC queue size
>> ethtool -g eth1
@danish-rehman
danish-rehman / inf_current_driver
Created January 8, 2015 08:26
Information of current driver
>> ethtool -i eth2
driver: e1000e
version: 2.3.2-k
firmware-version: 5.10-2
bus-info: 0000:03:00.1
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
@danish-rehman
danish-rehman / print_kernel
Created January 8, 2015 08:34
Print in kernel
# Linux source code
>> cd linux-3.16
# File : /net/core/dev.c
>> vim /net/core/dev.c
dev_hard_start_xmit()
printk(KERN_DEBUG "DANX: start %s:%s:%d\n" ,__FILE__ , __func__ ,__LINE__ );
@danish-rehman
danish-rehman / compile_legacy
Created January 8, 2015 18:46
Compile and Run Legacy NTP
# Install dependency
>> sudo apt-get install libcap-dev
# Create directory for installed
>> mkdir /proj/USC558L/exp/drehman/usr
# Download the legacy ntp source code
>> wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.6p5.tar.gz
# Configure
>> ./configure --prefix=/proj/USC558L/exp/drehman/usr --sysconfdir=/proj/USC558L/exp/drehman/etc --enable-linuxcaps --with-binsubdir=sbin --with-lineeditlibs=readline
# Compile
>> make
@danish-rehman
danish-rehman / run_legacy_ntp
Created January 8, 2015 19:41
Run legacy ntp executable
# Go the directory containing the executables
>> cd /proj/USC558L/exp/drehman/usr/sbin
# l - path to the log file
# d - debug mode on
>> ./ntpd -l path_to_logfile -d
@danish-rehman
danish-rehman / edit_compile_run
Created January 8, 2015 19:56
Edit and Compile
# Edit the code
>> vim ntpd/ntpd_conf.c
>> make
>> make install
@danish-rehman
danish-rehman / change_date
Created January 8, 2015 20:05
Change date of ubuntu
# Change date on ubuntu
>> sudo date --set "8 Nov 2014 14:41:33"
@danish-rehman
danish-rehman / ntp_commands
Last active August 29, 2015 14:13
NTP Commands
# Install NTP from ubuntu repository
>> sudo apt-get install ntp
# View all the NTP master and their offset recieved
>> ./ntpd -p
# Exactly like the above command but with no ip address rather then name
>> ./ntpd -n
# Query a NTP master server
@danish-rehman
danish-rehman / ntp_source_code_conf
Created January 8, 2015 20:43
NTP Source code and Configuration
# Change master NTP server
>> vim /etc/ntp.conf
server node2.test1.usc558l
# Change source code for ntpupdate
>> vim ntpdate / ntpdate.c
grep "static int clock_adjust(void)"
# Change source code to stop NTP from changing time
# Add "return 0" as soon as the function
@danish-rehman
danish-rehman / check_queue
Last active August 29, 2015 14:13
Check queue parameters
# Defaults to 256 descriptors
>> ethtool -g eth4
Ring parameters for eth4:
Pre-set maximums:
RX: 4096
RX Mini: 0
RX Jumbo: 0