Skip to content

Commit 9f2f48f

Browse files
committed
These are what I learned in 2017-08-06.
1 parent ca4acf2 commit 9f2f48f

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
- Date : 2017-08-06
2+
- Tags : #java #security
3+
4+
## Runing old java applets on brower
5+
6+
Mostly morden browser has stop support Java plugins, so you can't run Java applet on browser.
7+
8+
Temporary way :
9+
- run in IE or Safari
10+
- run in an old Firefox (version 23)
11+
12+
And what if old java applet can't be runned on Java 8 because of weak signature algorithm. Try this
13+
14+
- Open `java.security` file :
15+
- In MacOS, located in `/Library/Java/JavaVirtualMachines/jdk[jdk-version].jdk/Contents/Home/jre/lib/security`
16+
- In Windows, located in `C:\Program File x86\Java\jre\lib\security`
17+
- Comment this line, ```jdk.certpath.disabledAlgorithms=MD2, MD5, RSA keySize < 1024```
18+
- Rerun applet
19+

php/realpath-function.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
- Date : 2017-08-06
2+
- Tags : #php #mistake
3+
4+
## realpath function
5+
6+
If you pass a non-exists path to function `realpath`, it returns empty string. So please don't do something like :
7+
8+
```php
9+
function storage_path($folder) {
10+
return realpath(__DIR__.'/storage/'.$folder);
11+
}
12+
```
13+
14+
if you expect it return full path of new folder !
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
- Date : 2017-08-06
2+
- Tags : #sysadmin #linux #kernel
3+
4+
## Cleaning up old linux kernels
5+
6+
Last day, I try to reboot a production server which has out-of-space /boot (I upgraded many kernels without rebooting, so system doesn't clean up old ones). And in the end, doom day had come ! It installed new kernel failed and booting to that kernel. My system crashed !
7+
8+
So, I learned from it :
9+
10+
- Never ever upgrade kernel without cleaning up old ones (just reboot)
11+
- Never ever reboot a production without backup
12+
- MORE IMPORTANT, NEVER do 2 above things at same time in the weekend !!!
13+
14+
**Solution** :
15+
16+
- Check current kernel : `uname -r`
17+
- List all kernels : `dpkg --list | grep linux-image `
18+
- Remove a kernel : `sudo apt-get purge linux-image-x.x.x-x-generic`
19+
- Finally, update grub after removing all old kernels : `sudo update-grub2`
20+
21+
- YOLO command for DEBIAN distros (to remove all of old kernels in 1 line), from [AskUbuntu](https://askubuntu.com/a/254585)
22+
23+
```bash
24+
dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p' | xargs sudo apt-get -y purge
25+
```
26+
27+
THEN, `sudo reboot`

0 commit comments

Comments
 (0)