macbook制作linux启动U盘

下载iso系统文件

下载哪种系统看自己喜欢,这次例子是以linux mint为例

iso文件转成dmg镜像文件

~/Downloads $ hdiutil convert -format UDRW -o linuxmint.dmg linuxmint-19-cinnamon-64bit.iso
正在读取Driver Descriptor Map(DDM:0)…
正在读取Linux Mint 19 Cinnamon 64-bit   (Apple_ISO:1)…
正在读取Apple(Apple_partition_map:2)…
正在读取Linux Mint 19 Cinnamon 64-bit   (Apple_ISO:3)…
..............................................................................
正在读取EFI(Apple_HFS:4)…
..............................................................................
正在读取Linux Mint 19 Cinnamon 64-bit   (Apple_ISO:5)…
..............................................................................
已耗时: 5.026s
速度:368.9M 字节/秒
节省:0.0%
created: /Users/chenjinle/Downloads/linuxmint.dmg

继续阅读

Linux获取文件或文件夹完整路径

在shell脚本中,经常需要通过一个文件,获取文件当前的路径和以此文件目录再转到相关的其它目录,可以通过readlink命令去获取,看下面的遝

[root@dev test]# readlink -f dwz/index.html
/media/sf_wwwroot/test/dwz/index.html
[root@dev test]# dirname `readlink -f dwz/index.html`
/media/sf_wwwroot/test/dwz
[root@dev test]# dirname $(readlink -f dwz/index.html)
/media/sf_wwwroot/test/dwz
[root@dev test]# dirname $(readlink -f dwz/../../yii/index.php)
/media/sf_wwwroot/yii
[root@dev test]#

继续阅读

CentOS下php5与php7共存

先安装php7

安装过程略,路径在/usr/local/php

安装php5

// php-5.6.10
./configure --prefix=/usr/local/php5 --enable-fpm --with-config-file-path=/usr/local/php5/etc  --with-libxml-dir --with-zlib --enable-bcmath  --with-curl  --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir  --enable-gd-native-ttf --enable-mbstring --with-mcrypt --with-mhash --with-mysql --with-mysqli --with-pdo-mysql --with-iconv-dir=/usr --enable-zip --enable-sockets
make ZEND_EXTRA_LIBS='-liconv'
make install
cp php.ini-production /usr/local/php5/etc/php.ini

继续阅读

VirtualBox安装增强功能出错解决(debian版)

错误信息 /var/log/vboxadd-install.log

/tmp/vbox.0/Makefile.include.header:112: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
cjinle@debian:/mnt$ sudo apt-get install kernel-headers kernel-devel
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package kernel-headers
E: Unable to locate package kernel-devel
</directory>

继续阅读

mount: wrong fs type, bad option, bad superblock错误解决

新安装的debian上,想挂载nfs分区,发现报了以下的错误

cjinle@debian:/sbin$ sudo /bin/mount -t nfs -o hard 192.168.1.129:/nfs /data
mount: wrong fs type, bad option, bad superblock on 192.168.1.129:/nfs,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
 
       In some cases useful info is found in syslog - try
       dmesg | tail or so.
</type>

继续阅读

Linux下bc计算器输入输出进制切换

众所周知,Linux的终端计算器bc非常强大且好用。
今天我们就介绍一下如果在bc进行进制之间切换的。

一、如果用一条命令来转数字,可以用echo命令和管道结合bc。如下:

10进制转2进制:

[root@localhost ~]# echo "obase=2;ibase=10;255" | bc
11111111

10进制转16进制:

[root@localhost ~]# echo "obase=16;ibase=10;255" | bc
FF

继续阅读