ubuntu16 install postgresql 9.6

https://www.postgresql.org/download/linux/ubuntu/

1.add source
echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' > /etc/apt/sources.list.d/pgdg.list
2.update system
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
sudo apt-key add -
sudo apt-get update

3.install
apt-get install postgresql-9.6


5.add path
su postgres && cd ~
#vi .bash_profile
PATH=$PATH:/usr/lib/postgresql/9.6/bin/
alias ll="ls -la"
export PATH
source .bash_profile

6.init db and start/stop service
initdb /var/lib/postgresql/test
pg_ctl -D /var/lib/postgresql/test -l logfile start
pg_ctl -D /var/lib/postgresql/test -l logfile stop

英文简写

asl = Age, sex and location = 年龄,性别和地址(国籍)
lol = laugh out loud = 大声笑,笑的很开心的样子
ppl = people
bbs = be back soon = 很快回来
thx = thanks
ur = your
asap = as soon as possible
g2g = got to go
ttyl = talk to you later
brb = be right back
bbl = be back later
bio brb = 上个厕所就回
afk = away from keyboard
u = you
plz = please
y = why
w8 = wait
l8er = later
cya = see ya (later)
nvm = nevermind
nm = not much
gl = good luck
gf = girlfriend
bf = boyfriend
luv = love
ruok = are you ok?
sp = support
cu = see u
cul8er = see you later
ft = faint
ic =i see
soho = small office home officer
btw = by the way
gn = gn8 = gnight = good night = 晚安
nn = nite = 晚安 (通常第一个人常说gnight/gn8,然后第二个人用nite,后面的用nn什么的都可以了。没有为什么,约定俗成而已。)
hiho = hola = yo = hi = hey = hellow = ello你好,大家好
wuz up = sup = what’s up = 怎么样你?/有什么事儿嘛?(也可作为问好用(限于比较熟的两个人之间的问候),回答时有事说事,没事用”nothing/nothin much/not much/nm等回答就可以。)
OMG = oh my god = 我的天;我靠!
OMFG = oh my fucking god = 我的老天;我靠!
wtf = what the fuck = 怎么会事!?我日!
OMGWTFBBQSOURCE !!! = 震惊到了极致
n1 = nice 1 = nice one = 漂亮
pwnz = ownz = 牛比!(例句:pwnz demo! lefuzee ownz all the others!)
rullz = 强!(例句:lefuzee rullz! you guyz rull!!!)
you rock! = 你牛比!
lmao = laughing my ass off = 笑的屁股尿流
rofl = roll on floor laughing = 笑翻天了
roflmao = rofl + lmao = 笑到爆了!
语气强度排序:hehe<haha<lol<muwahaha<lmao<rofl<roflmao

—其他简写—
FU = fuck you = 操你;滚
STFU = Shut the fuck up! = 他妈的给我闭嘴!
k = ok = okay = okie = 好的,恩
sux = suck的第3人称单数形势(例句:that sux)=sb;滥,差劲
gimme = give me =给我
xfer = transfer = 传输
em = them = 他们的宾格
thx = thanks = 谢谢
4get = forget = 忘记
happy bday = happy b-day = happy birthday! = 生日快乐
dunno = dont know = 不知道
kinda = a little bit = 有点(例句:The game is kinda hard for me.i kinda think i should get it done as soon as possible.)
tho = though = 虽然尽管(例句:That demo was very nice,kinda old tho.那个demo很不错,虽然有点老)
plz = please = 请
cmon = c’mon =come on
suka = sucker suck(吮吸),er(表“人”),吮吸的人…没天真到无邪的人应该都能明白。
enuff = enough = 足够
hax = hack = cheat = 作弊,说谎(很地道时尚的词,老外用的比较多)
ty = thank you 原本用的不多,不过现在又开始兴起来了
conn = connection = 线路,网络,网络类型 (例句:what conn do you have? / cable )
asap = as soon as possible 尽快
imo = in my opinion 我认为
smh = shake my head (摇头叹气)
dayum = damn = dang
ttyl = talk to you later
b/c = because
j/j = j/k = j/p = just joking, kidding, playing (开玩笑)
w/ = with
w/o = without
holla = 来和我讲话,also, holla at yo boy, holla at yo girl etc.
atcha = at you
gotcha? = got you?

<strong>—特殊用语—</strong>
w00t = woot = what = 虾米?!主要表示what和yeah的意思,例如惊叹和兴奋。
1337 = l337 = l33t = leet = elite = 很强,超强(例句:l33t demo;lefuzee is l337!!!!)
lame = 滥;衰 (例句:dude,thats the lamest thing ive ever heard.哥们,这是我听过的最sb的事情。)
dude = d00d = (原意:花花公子)哥们,朋友
pffffff = whatever = 随便;爱咋咋地; (”f”的多少和”pffffffff”的长短代表你的感情激烈程度)
n00b = newbie = 新人,新手;小嫩手
sry = 不好意思;

—表情符—
:)
; D
; o
; o
:> — (gay smile)
\o/ — (欢庆)
\\o — (欢庆)
o// — (欢庆)
D: — (吃惊)
Oo = O_o = 虾米!(挣大眼睛表示惊叹)
<3 = 心,表示喜爱
2 = to
4 = for
B = be
U = you
R = are
C = see
AFK = away from keyboard
ASAP = as soon as possible
BTW = by the way
BBIAM = be back in a minute
CU = see you
CUL = see you later
CWYL = char with you later
FE = for example
F2F = face to face
FYI = for your information(供参考)
FYR = for your reference
FU = …这个不用说了吧 0_0
GL = good luck
GTG = got to go
GTH = go to hell
HTH = hit the hay(睡觉去了,hay:床)
IAC = in any case
ILY = i love you
IMO = in my opinion
KIT = keep in touch
NRN = no reply necessary(不必回信)
NP = no problem
OMG = oh my god
OIC = oh i see
OTOH = on the other hand
ORLY = oh really?
PEM = privacy enhanced mail(保密邮件)
RSN = real soon now(马上)
TM = trust me
WB = welcome back
WTG = way to go
WYP = what’s your problem?

ubuntu升级内核

需求:升级内核版本到4.8.0-58

1.更新包
#apt-get update
2.查看相关包
#apt-cache search linux-image|grep 4.8.0-58-generic
#apt-cache search linux-headers|grep 4.8.0-58
3.安装相关包
#apt-get install linux-image-4.8.0-58-generic linux-image-extra-4.8.0-58-generic linux-headers-4.8.0-58-generic
4.检查:
安装完后,有几个目录可以检查下,做运维要小心
新内核模块会在这个目录 /lib/modules/4.8.0-58-generic/
看一下一些启动加载项
#ll /vmlinuz
lrwxrwxrwx 1 root root 29 Sep 28 23:07 /vmlinuz -> boot/vmlinuz-4.8.0-58-generic
#ll /initrd.img
lrwxrwxrwx 1 root root 32 Sep 28 23:07 /initrd.img -> boot/initrd.img-4.8.0-58-generic
#cat /boot/grub/grub.cfg |grep -vE ‘^$|#’|grep 4.8.0-58-generic
initrd /initrd.img-4.8.0-58-generic
5.重启
#reboot
6.测试
#uname -r
4.8.0-58-generic

golang处理异常之panic,recover, exit status1

golang语言对错误的处理只有Panic和Recover.

go中可以抛出一个panic的异常,然后在defer中通过recover捕获这个异常,然后正常处理

在一个主进程,多个go程处理逻辑的结构中,这个很重要,如果不用recover捕获panic异常,会导致整个进程出错中断

 

在写程序时,如果不进行处理就会一级一级向上抛出异常直到程序崩溃退出。

如何使用这两个方法处理异常呢?

我们可以定义个函数,在需要检测错误的地方引用 一下:

func CheckErr(err error) {
       if err != nil {
              panic(err)
       }
}
func demo( sourcefile string)  {
       defer func() {
              if x := recover(); x != nil {
                     fmt.Println(x)
              }
       }()
       
       _, err := ioutil.ReadFile(sourcefile)
       CheckErr(err)
}

总结就是在需要处理错误的方法里,panic抛出异常,recover接住异常。

还有一种是exit status 1,这个时候要看下是否用了log函数。

logger.Panic

logger.Fatal 会抛出这个异常。

 

理想还是要有的

很多次我问别人有理想吗?然后说自己没理想。

其实,理想是有的。我一直想写点属于自己的东西。

但是上学那会:字写的不好,语文是我最差的科目。

也许,我不该轻言放弃,你说是吗?

最近时常怀念过去

最近时常怀念过去。怀念老朋友,怀念曾经的自己。

有人说开始是怀念过去是老了的表现。当我拿出身份证,25周岁了,不算老吧?

可是,有种感觉,伴随了我有几年了,就是心态的变老。变的老气横秋,不懂的及时行乐。我时常羡慕同龄的小伙伴。玩的时候可以放的很开。

我也不是一直像现在这个样子,往前推几年我也可以玩的很开。也许是这两年事情太多了。

岁月催人老啊。