linux一路填坑...
1、安装ubuntu
从ubuntu9.0开始,一路更新,越来越垃圾,更可恶的是工作上经常指定特定的版本,于是乎,我电脑里装了n个版本的ubuntu.
Win7 + Ubuntu 15.10
1)装完win7之后,删除一个分区留给ubuntu用
2)接着装完ubuntu 15.10 ,发现windows7不能启动,启动文件损坏。
3)运行sudo update-grub2修复启动文件ok.
dong@ubuntu:~$ sudo update-grub2 [sudo] dong 的密码: Generating grub configuration file ... Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported. Found linux image: /boot/vmlinuz-4.2.0-16-generic Found initrd image: /boot/initrd.img-4.2.0-16-generic Found memtest86+ image: /boot/memtest86+.elf Found memtest86+ image: /boot/memtest86+.bin Found Windows 7 (loader) on /dev/sda1 done dong@ubuntu:~$
如何安装win7/win10和linux [ubuntu16.04LTS]双系统(与原系统共存方式)
https://blog.csdn.net/doublezsx/article/details/79674725
2、linux指令备忘
apt-get install xxxx 安装
apt-get remove xxxx 卸载但不删除配置
apt-get purge xxxx 卸载并且删除相关配置
grep -rn "hello,world" *
3、source /etc/profile永久生效
命令来把某个路径加入.bashrc文件。
echo "source /etc/profile" >> ~/.bashrc
然后通过
source ~/.bashrc
4、VM
sudo apt-get install lib32ncurses5 lib32z1
sudo apt-get install libglib2.0-dev
error while loading shared libraries: libstdc++.so.6: cannot open shared obj
原因在于,ubuntu,ia32_libs 被废弃了导致没有32位的lib库。
解决方法
sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1
export PATH="$PATH:/usr/local/gcc-linaro-arm-linux-gnueabihf/bin"
echo "export PATH=$PATH:/usr/local/gcc-linaro-arm-linux-gnueabihf/bin" >> ~/.bashrc
echo "export PATH=$PATH:/usr/local/gcc-linaro-arm-linux-gnueabihf/bin" >> ~/.bashrc
export PATH=/usr/local/node-v4.9.1-linux-armv7l/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/node-v4.9.1-linux-armv7l/lib:$LD_LIBRARY_PATH
export PATH="/usr/local/node-v4.9.1-linux-armv7l/bin:"$PATH
export LD_LIBRARY_PATH="/usr/local/node-v4.9.1-linux-armv7l/lib:"$LD_LIBRARY_PATH
export PATH=$PATH:/usr/local/node-v4.9.1-linux-armv7l/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/node-v4.9.1-linux-armv7l/lib
export PATH="$PATH:/usr/local/node-v4.9.1-linux-armv7l/bin"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/node-v4.9.1-linux-armv7l/lib"
在你的工程源代码里包含.h头文件,然后可以调用动态库里的函数,在链接的时候加上如下编译器参数:
-l xx.so
如果你的so文件是以lib开头的,还可以直接这样使用:
-lxx
xx是你的.so文件名
parted -l
fdisk /dev/sda
n p 3 w
parted -l
partprobe
df
mkfs.ext4 /dev/sda3
mount /dev/sda3 /root
2) minicom
3) nfs
pc:
sudo vi /etc/exports
/home/dong/_install *(rw,sync,no_root_squash,no_subtree_check)
sudo /etc/init.d/nfs-kernel-server restart
sudo /etc/init.d/rpcbind restart
sudo ifconfig eth0 172.16.23.157 broadcast 172.16.23.254 netmask 255.255.255.0
board:
ifconfig eth0 172.16.23.158 broadcast 172.16.23.254 netmask 255.255.255.0
mount -t nfs -o nolock 172.16.23.157:/home/dong/_install /root/_install
gcc -o main main.c \
-I $(pwd) \
-I $(pwd)/ffmpeg/include \
-I $(pwd)/ffmpeg/include/libavcodec \
-I $(pwd)/ffmpeg/include/libavdevice \
-I $(pwd)/ffmpeg/include/libavfilter \
-I $(pwd)/ffmpeg/include/libavformat \
-I $(pwd)/ffmpeg/include/libavutil \
-I $(pwd)/ffmpeg/include/libpostproc \
-I $(pwd)/ffmpeg/include/libswresample \
-I $(pwd)/ffmpeg/include/libswscale \
-I $(pwd)/ffmpeg/include/libpostproc \
-I $(pwd)/ffmpeg/include/libyasm \
-I $(pwd)/ffmpeg/include/SDL2 \
-L $(pwd)/ffmpeg/lib \
-Wno-deprecated-declarations -lx264 -lSDL2 -lavformat -lavutil -lavdevice -lavcodec -lswresample -lavfilter -lswscale -lpostproc -lz -lm -lpthread -std=c99
12、linux syslog服务器配置,自动发日志到另一台日志服务器
修改/etc/syslog.conf 添加
syslog.info @168.1.80.30
2.日志服务器:168.1.80.30
修改/etc/sysconf/syslog 修改SYSLOGD_OPTIONS为 "-r -x -m 0" #-r表示允许接收外来的消息,-x表示不解析DNS,
#-m 0表示时间戳标记间隔,如果指定只接受某个或多个ip过来的日志,例"-s 168.1.1.1:168.1.1.2"
修改/etc/syslog.conf 添加
syslog.info;syslog.!err;syslog.!crit;syslog.!alert /var/log/mylog #info信息记录到日志服务器的/var/log/mylog中
syslog.err /var/log/testerror #error信息记录到日志服务器的/var/log/testerror中
3.客户端和日志服务器都执行service syslog restart
4.经测试,可以分类存放日志到不同的文件。测试方法:在客户端程序如下程序:
#include <stdio.h>
#include <syslog.h>
int main(int argc, char* argv[])
{
//openlog(argv[0], LOG_CONS | LOG_PID, LOG_USER);
int count = 0;
while(count<5){
syslog(LOG_SYSLOG|LOG_INFO, "%d:, syslog user test", count);
count++;
}
//closelog();
return 0;
}
13. unrecognized relocation (0x2a) in section `.text`
https://blog.csdn.net/daxiang10m/article/details/93190949
14. sudo make install
sudo make install
mkdir -p /usr/local/include/hiredis /usr/local/include/hiredis/adapters /usr/local/lib
cp -pPR hiredis.h async.h read.h sds.h alloc.h /usr/local/include/hiredis
cp -pPR adapters/*.h /usr/local/include/hiredis/adapters
cp -pPR libhiredis.so /usr/local/lib/libhiredis.so.1.0.0
cd /usr/local/lib && ln -sf libhiredis.so.1.0.0 libhiredis.so
cp -pPR libhiredis.a /usr/local/lib
mkdir -p /usr/local/lib/pkgconfig
cp -pPR hiredis.pc /usr/local/lib/pkgconfig