headermap cache got stuck? - cakephp

In Cakephp 1.3 I have a caching problem: the webroot/img/imagecache/headermap got stuck somehow. I cannot ls or du the contents. The disk device is full and I suspect the headermap being the culprit:
drwxrwxrwx 2258 abc www-data 61440 Sep 23 09:40 avatars
drwxrwxrwx 3 abc www-data 4096 Jan 27 2012 gallery
drwxrwxrwx 2 abc www-data 132255744 Sep 25 11:49 headermap
Can I just rm -rf headermap? Or is this unwise?

Related

Created programs compiled with gcc using root,now I am into problems about not having execution permission & chmod gives .o file with EXE format error

I have simple code files and Makefile the generates some executable files. Now I am having problem with running it. First that the output of gcc is not giving me .o file with execution permission. Which is surprising, at the bottom is my makefile I ran into these issues below.
With ls -lh command it says I only have maximum read and write permission to a writeshmem.o. same for all files in the directory. Even though I don't remember setting any system wide permission for outputting .o file without execution permission from gcc. And I DO NOT REMEMBER REVOKING ROOT USER PERMISSION.
root#fawad:/home/fawad/Desktop/Shared# ls -lh
total 44K
-rw-r--r-- 1 root root 263 Sep 6 14:07 Makefile
-rw-r--r-- 1 root root 359 Sep 6 14:10 destroy_shmem.c
-rw-r--r-- 1 root root 3.9K Sep 6 14:10 destroy_shmem.o
-rw-r--r-- 1 root root 381 Sep 6 13:40 readshmem.c
-rw-r--r-- 1 root root 4.1K Sep 6 14:14 readshmem.o
-rw-r--r-- 1 root root 1014 Sep 6 11:58 shared_memory.c
-rw-r--r-- 1 root root 267 Sep 6 14:09 shared_memory.h
-rw-r--r-- 1 root root 490 Sep 6 13:30 writeshmem.c
-rw-r--r-- 1 root root 4.2K Sep 6 14:14 writeshmem.o
As u can see there is no execution x
After above when I gave permission with
root#fawad:/home/fawad/Desktop/Shared# chmod +rwx writeshmem.o
I got this error
root#fawad:/home/fawad/Desktop/Shared# ./writeshmem.o
bash: ./writeshmem.o: cannot execute binary file: Exec format error
What that above error even means. It make no sense to me how giving permission to a file messed up with the EXecution format of the file. Someone can please explain why it matters for a file to cause this error. I only change the permission.
Makefile
CC=gcc
CFLAGS=-g -Wall
OBJS=shared_memory.o
EXE=writeshmem.o readshmem.o destroy_shmem.o
all: $(EXE)
%.o: %.o $(OBJS)
$(CC) $(CFLAGS) $< $(OBJS) -o $#
%.o: %.c %.h
$(CC) $(CFLAGS) -c $< -o $#
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $#
clean:
rm .o $(EXE)
Update
after reading comment(You should remove the .o from the executable names) by kaylum I removed .o from executables in makefile But I still get error
root#fawad:/home/fawad/Desktop/Shared# ./writeshmem
bash: ./writeshmem: Permission denied
and same output from ls -lh
-rw-r--r-- 1 root root 251 Sep 6 14:59 Makefile
-rw-r--r-- 1 root root 3.9K Sep 6 15:00 destroy_shmem
-rw-r--r-- 1 root root 359 Sep 6 14:10 destroy_shmem.c
-rw-r--r-- 1 root root 4.1K Sep 6 15:00 readshmem
-rw-r--r-- 1 root root 381 Sep 6 13:40 readshmem.c
-rw-r--r-- 1 root root 1014 Sep 6 11:58 shared_memory.c
-rw-r--r-- 1 root root 267 Sep 6 14:09 shared_memory.h
-rw-r--r-- 1 root root 4.2K Sep 6 15:00 writeshmem
-rw-r--r-- 1 root root 490 Sep 6 13:30 writeshmem.c
everything including writeshmem is still with only rw permission and without x

Building PLX SDK driver in Linux yields "No such file or directory"

I am trying to build source code and running into grief.
[root#localhost Driver]# pwd
/usr/src/PlxSdk/Driver
[root#localhost Driver]# ls -la
total 36
drwxr-xr-x. 7 root root 183 Sep 15 18:10 .
drwxr-xr-x. 8 root root 123 Sep 15 18:10 ..
-rwxr-xr-x. 1 root root 658 Sep 15 18:10 buildalldrivers
-rwxr-xr-x. 1 root root 4524 Sep 15 18:10 builddriver
-rw-r--r--. 1 root root 590 Sep 15 18:10 Makefile
...
[root#localhost Driver]# ./buildalldrivers
------------------
Build: Plx8000_NT
- PLA: CentOS Linux release 8.2.2004 (Core)
- KER: 4.18.0-193.el8.x86_64
- INC: /lib/modules/4.18.0-193.el8.x86_64/build/include
- CPU: x86_64 (64-bit Little Endian)
- CMP: gcc
- TYP: 8000_NT Driver
- PKG: PCI/PCIe SDK v8.00
- CFG: Release
make[1]: *** /lib/modules/4.18.0-193.el8.x86_64/build: No such file or directory. Stop.
make: *** [/usr/src/PlxSdk/Makefiles/Targets.def:46: BuildDriver] Error 2
------------------
I saw this informative SO post, which talks of my problem, but none of the answers helped.
Use $ uname -r to check the kernel version
4.18.0-193.el8.x86_64
The complaint is No such file or directory, however there is a build directory and the kernel developer tools do exist.
[root#localhost Driver]# ls -la /lib/modules/4.18.0-193.el8.x86_64
total 16440
drwxr-xr-x. 6 root root 4096 Sep 15 20:20 .
drwxr-xr-x. 4 root root 64 Sep 14 14:27 ..
-rw-r--r--. 1 root root 295 May 8 07:07 bls.conf
lrwxrwxrwx. 1 root root 54 Sep 15 20:20 build -> ../../../usr/src/kernels/4.18.0-193.14.2.el8_2.x86_64/
-rw-r--r--. 1 root root 187648 May 8 07:07 config
drwxr-xr-x. 12 root root 128 Sep 14 14:27 kernel
-rw-r--r--. 1 root root 865312 Sep 14 14:31 modules.alias
-rw-r--r--. 1 root root 827199 Sep 14 14:31 modules.alias.bin
-rw-r--r--. 1 root root 488 May 8 07:07 modules.block
-rw-r--r--. 1 root root 7534 May 8 07:07 modules.builtin
-rw-r--r--. 1 root root 9748 Sep 14 14:31 modules.builtin.bin
-rw-r--r--. 1 root root 287699 Sep 14 14:31 modules.dep
-rw-r--r--. 1 root root 397124 Sep 14 14:31 modules.dep.bin
-rw-r--r--. 1 root root 365 Sep 14 14:31 modules.devname
-rw-r--r--. 1 root root 140 May 8 07:07 modules.drm
-rw-r--r--. 1 root root 59 May 8 07:07 modules.modesetting
-rw-r--r--. 1 root root 1602 May 8 07:07 modules.networking
-rw-r--r--. 1 root root 100539 May 8 07:07 modules.order
-rw-r--r--. 1 root root 553 Sep 14 14:31 modules.softdep
-rw-r--r--. 1 root root 414722 Sep 14 14:31 modules.symbols
-rw-r--r--. 1 root root 505717 Sep 14 14:31 modules.symbols.bin
lrwxrwxrwx. 1 root root 5 May 8 07:07 source -> build
-rw-r--r--. 1 root root 347581 May 8 07:07 symvers.gz
-rw-------. 1 root root 3909996 May 8 07:07 System.map
drwxr-xr-x. 2 root root 6 May 8 07:06 updates
drwxr-xr-x. 2 root root 40 Sep 14 14:27 vdso
-rwxr-xr-x. 1 root root 8913656 May 8 07:07 vmlinuz
-rw-r--r--. 1 root root 166 May 8 07:06 .vmlinuz.hmac
drwxr-xr-x. 3 root root 23 Sep 14 14:30 weak-updates
[root#localhost Driver]#
The build link is valid and blinking.
[root#localhost Driver]# ls -la /usr/src/kernels/4.18.0-193.14.2.el8_2.x86_64/
total 5348
drwxr-xr-x. 24 root root 4096 Sep 15 20:56 .
drwxr-xr-x. 3 root root 42 Sep 15 17:13 ..
drwxr-xr-x. 26 root root 4096 Sep 15 17:13 arch
drwxr-xr-x. 3 root root 78 Sep 15 17:13 block
drwxr-xr-x. 2 root root 37 Sep 15 17:13 certs
-rw-r--r--. 1 root root 187644 Jul 26 00:02 .config
drwxr-xr-x. 4 root root 76 Sep 15 17:13 crypto
drwxr-xr-x. 135 root root 4096 Sep 15 17:13 drivers
drwxr-xr-x. 2 root root 22 Sep 15 17:13 firmware
drwxr-xr-x. 73 root root 4096 Sep 15 17:13 fs
drwxr-xr-x. 30 root root 4096 Sep 15 17:14 include
drwxr-xr-x. 2 root root 37 Sep 15 17:14 init
drwxr-xr-x. 2 root root 22 Sep 15 17:14 ipc
-rw-r--r--. 1 root root 575 Jul 26 00:02 Kconfig
drwxr-xr-x. 17 root root 4096 Sep 15 17:14 kernel
drwxr-xr-x. 16 root root 4096 Sep 15 17:14 lib
-rw-r--r--. 1 root root 60925 Jul 26 00:02 Makefile
-rw-r--r--. 1 root root 1325 Jul 26 00:02 Makefile.rhelver
drwxr-xr-x. 3 root root 71 Sep 15 17:14 mm
-rw-r--r--. 1 root root 0 Sep 15 20:51 modules.order
-rw-r--r--. 1 root root 1241984 Jul 26 00:02 Module.symvers
drwxr-xr-x. 70 root root 4096 Sep 15 17:14 net
drwxr-xr-x. 26 root root 4096 Sep 15 17:14 samples
drwxr-xr-x. 13 root root 8192 Sep 15 17:14 scripts
drwxr-xr-x. 10 root root 151 Sep 15 17:14 security
drwxr-xr-x. 26 root root 4096 Sep 15 17:14 sound
-rw-r--r--. 1 root root 3910607 Jul 26 00:02 System.map
drwxr-xr-x. 2 root root 6 Sep 15 20:51 .tmp_versions
drwxr-xr-x. 29 root root 4096 Sep 15 17:14 tools
drwxr-xr-x. 2 root root 37 Sep 15 17:14 usr
drwxr-xr-x. 4 root root 44 Sep 15 17:14 virt
-rw-r--r--. 1 root root 41 Jul 26 00:02 vmlinux.id
[root#localhost Driver]#
sudo dnf install kernel-devel-$(uname -r)
Already installed
#Nighthawk663 in his answer stated Notice that the "source" link is also broken because it points to build. My Source link also points to build, but nothing that I did has it going anywhere else. I do not know if that is a valid comment or not.
[root#localhost Driver]# rpm -i /home/mnvme/Downloads/kernel-devel-4.18.0-193.el8.x86_64.rpm
package kernel-devel-4.18.0-193.14.2.el8_2.x86_64 (which is newer than kernel-devel-4.18.0-193.el8.x86_64) is already installed
[root#localhost Driver]#
The PLX SDK Linux Support Release Notes page stated some requirements, which I followed:
In order to build the files supplied, the shell environment variable PLX_SDK_DIR must be set. This should be set to the root location of where the PlxSdk folder is created.
# export PLX_SDK_DIR=$HOME/PlxSdk
#
# Or in my case
export PLX_SDK_DIR=/usr/src/PlxSdk
I did update my .bashrc file with that line and the comment.
I wanted to verify that gcc works and that there is no issue with the compiler, so I built the API and one of the samples. Here is the output from building one of the samples.
[root#localhost Samples]# cd ApiTest
[root#localhost ApiTest]# make
Build: ApiTest
- PLA: CentOS Linux release 8.2.2004 (Core)
- CPU: x86_64 (64-bit Little Endian)
- CMP: gcc
- TYP: Sample App
- PKG: PCI/PCIe SDK v8.00
- CFG: Release
CC /usr/src/PlxSdk/Samples/Shared/ConsFunc.c
CC /usr/src/PlxSdk/Samples/Shared/PlxInit.c
CC ApiTest.c
LNK ApiTest
Application "App/ApiTest" built successfully
[root#localhost ApiTest]# cd ..
[root#localhost Samples]#
As such, the problem is strictly building the driver and in particular there is something with the kernel that makes the build tools not happy.
Attempting to load the driver states that I did not build the driver, as expected. (I am also stating the load command for completeness sake.)
[root#localhost Bin]# ./Plx_load 8000d d
Install: Plx8000_DMA_dbg
Load module......... ERROR: Driver not built or invalid path
\-- /usr/src/PlxSdk/Driver/Source.Plx8000_DMA/Output/Plx8000_DMA_dbg.ko
[root#localhost Bin]#
NOTE:
The PLX Release Notes states the following, which apply to my problem.
Kernel 2.6
Kernel 2.6 introduced the Linux kernel build system. In order to build PLX drivers, or any other drivers for that matter, the Linux build system requires the following:
·Linux kernel development package, which matches the destination kernel version, must be installed
·In some cases, the current running kernel must be configured and built manually
If the PLX driver fails to build, please verify the requirements mentioned above are met.
I have the Linux kernel development package matching the destination kernel version as discussed previously, and I am not sure about the second point. I will investigate that.
Thoughts?
The specific answer to the problem was to create the symbolic link without the ../../.. like on the samples.
I executed as root the command from the /lib/modules/4.18... directory.
ln -s /usr/src/kernels/4.18.0-193.14.2.el8_2.x86_64/ build
Doing so then yielded a solid blue on black link to which I was able to do a CD into that.
I was then able to get to my next problem, but first problem resolved.
The funny thing is that I tried the above command before. Maybe I had to install something and then do that line. All I know is the culmination of everything above resolved the issue. Thanks to #JohnBollinger for the steer to the right direction.
[mnvme#localhost Driver]$ ./buildalldrivers
------------------
Build: Plx8000_NT
- PLA: CentOS Linux release 8.2.2004 (Core)
- KER: ver 4.18.0-193.14.2.el8_2.x86_64
- INC: /lib/modules/4.18.0-193.el8.x86_64/build/include
- CPU: x86_64 (64-bit Little Endian)
- CMP: gcc
- TYP: 8000_NT Driver
- PKG: PCI/PCIe SDK v8.00
- CFG: Release
arch/x86/Makefile:248: *** You are building kernel with non-retpoline compiler, please update your compiler.. Stop.
make: *** [/usr/src/PlxSdk/Makefiles/Targets.def:46: BuildDriver] Error 2
The solution to the non-retpoline error comes via a search and this post. I have to:
export the PLX_CHIP type of each project and make the project as root.
From a # prompt:
cd /usr/src/PlxSdk
export PLX_CHIP=8000_NT
make
export PLX_CHIP=8000_DMA
make
export PLX_CHIP=6000_NT
make
The 9000 code has a compiler bug.

How to build a static version of the pcap library for Arm Linux

I saw libpcap here https://github.com/the-tcpdump-group/libpcap?files=1
I have compiler for arm linux.
How can I build libpcap to a file so I can statically link to this lib in my project?
I didn't find MakeFile for Arm.
On Ubuntu 16.04 86_64 or later, assuming bison and flex were installed, and gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz was downloaded and extracted into the /opt directory, a possible procedure for cross-compiling the latest version from scratch would be:
wget https://github.com/the-tcpdump-group/libpcap/archive/libpcap-1.9.1.tar.gz
tar zxf libpcap-1.9.1.tar.gz
cd libpcap-libpcap-1.9.1
CROSS_COMPILE=/opt/arm/9/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf- CC=${CROSS_COMPILE}gcc ./configure --host=arm-none-linux-gnueabihf --prefix=$(pwd)/libpcap-1.9.1-arm-none-linux-gnueabihf
CROSS_COMPILE=/opt/arm/9/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf- CC=${CROSS_COMPILE}gcc make install
The libraries and include files will be installed in libpcap-libpcap-1.9.1/libpcap-1.9.1-arm-none-linux-gnueabihf:
ls -gG -a libpcap-1.9.1-arm-none-linux-gnueabihf/include libpcap-1.9.1-arm-none-linux-gnueabihf/lib
libpcap-1.9.1-arm-none-linux-gnueabihf/include:
total 24
drwxr-xr-x 3 4096 Feb 6 13:07 .
drwxrwxr-x 6 4096 Feb 6 13:07 ..
drwxr-xr-x 2 4096 Feb 6 13:07 pcap
-rw-r--r-- 1 2294 Feb 6 13:07 pcap-bpf.h
-rw-r--r-- 1 2226 Feb 6 13:07 pcap.h
-rw-r--r-- 1 2024 Feb 6 13:07 pcap-namedb.h
libpcap-1.9.1-arm-none-linux-gnueabihf/lib:
total 2108
drwxr-xr-x 3 4096 Feb 6 13:07 .
drwxrwxr-x 6 4096 Feb 6 13:07 ..
-rw-r--r-- 1 1199090 Feb 6 13:07 libpcap.a
lrwxrwxrwx 1 12 Feb 6 13:07 libpcap.so -> libpcap.so.1
lrwxrwxrwx 1 16 Feb 6 13:07 libpcap.so.1 -> libpcap.so.1.9.1
-rwxr-xr-x 1 942752 Feb 6 13:07 libpcap.so.1.9.1
drwxr-xr-x 2 4096 Feb 6 13:07 pkgconfig
I hope this helps.
Just a remainder: Flex and Bison can be installed using:
sudo apt-get install flex bison

Using ALSA library on Linux

Ubuntu 18.04
I'm very new to sounds programming in Linux and I'm trying to work with ALSA library. I have alsa-library installed on my machine as follows:
/dev/snd$ sudo apt-file list libasound2
libasound2: /usr/lib/x86_64-linux-gnu/libasound.so.2
libasound2: /usr/lib/x86_64-linux-gnu/libasound.so.2.0.0
libasound2: /usr/share/doc/libasound2/NEWS.Debian.gz
libasound2: /usr/share/doc/libasound2/changelog.Debian.gz
libasound2: /usr/share/doc/libasound2/copyright
libasound2: /usr/share/doc/libasound2/examples/asoundrc.txt.gz
But the problem is that my header files are completely different from what is specified in the documentation Files section:
ll /usr/include/sound/
total 208
drwxr-xr-x 2 root root 4096 Nov 15 07:06 ./
drwxr-xr-x 41 root root 4096 Nov 11 10:26 ../
-rw-r--r-- 1 root root 21847 Oct 23 17:44 asequencer.h
-rw-r--r-- 1 root root 19132 Oct 23 17:44 asoc.h
-rw-r--r-- 1 root root 4377 Oct 23 17:44 asound_fm.h
-rw-r--r-- 1 root root 45851 Oct 23 17:44 asound.h
-rw-r--r-- 1 root root 6743 Oct 23 17:44 compress_offload.h
-rw-r--r-- 1 root root 16992 Oct 23 17:44 compress_params.h
-rw-r--r-- 1 root root 17240 Oct 23 17:44 emu10k1.h
-rw-r--r-- 1 root root 2697 Oct 23 17:44 firewire.h
-rw-r--r-- 1 root root 3140 Oct 23 17:44 hdsp.h
-rw-r--r-- 1 root root 5486 Oct 23 17:44 hdspm.h
-rw-r--r-- 1 root root 4304 Oct 23 17:44 sb16_csp.h
-rw-r--r-- 1 root root 7494 Oct 23 17:44 sfnt_info.h
-rw-r--r-- 1 root root 11574 Oct 23 17:44 snd_sst_tokens.h
-rw-r--r-- 1 root root 4041 Oct 23 17:44 tlv.h
-rw-r--r-- 1 root root 1939 Oct 23 17:44 usb_stream.h
For instance no conf.h header and as a consequence no struct snd_devname_t; definition. ALSA version I got from the alsa-info script is the latest one currently available.
!!ALSA Version
!!------------
Driver version: k4.15.0-36-generic
Library version: 1.1.3
Utilities version: 1.1.3
Should I install some other package to get the all includes available? I did some file search
$ find / -name alsa 2>/dev/null
/etc/default/alsa
/etc/apm/scripts.d/alsa
/run/alsa
/usr/share/alsa
/usr/share/sounds/alsa
/usr/src/linux-headers-4.15.0-39-generic/include/config/thinkpad/acpi/alsa
/usr/src/linux-headers-4.15.0-36-generic/include/config/thinkpad/acpi/alsa
/usr/src/linux-headers-4.15.0-34-generic/include/config/thinkpad/acpi/alsa
/var/lib/alsa
/sbin/alsa
and did not notice them.

Why can't "go get" find $GOPATH when "go env" shows it's set correctly?

I'm attempting to get go version go1.6.4 darwin/amd64 installed on my Macbook Pro.
I can't seem to download remote packages with 'go get' despite having the $GOPATH set.
$ go env
GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/Bryan/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
$ ls /Users/Bryan/go
total 24
drwxr-xr-x 6 Bryan staff 204 May 23 12:13 .
drwxr-xr-x+ 73 Bryan staff 2482 May 25 11:20 ..
-rw-r--r--# 1 Bryan staff 8196 May 24 15:11 .DS_Store
drwxr-xr-x 32 Bryan staff 1088 Mar 28 14:21 bin
drwxr-xr-x 3 Bryan staff 102 Mar 28 14:21 pkg
drwxr-xr-x 10 Bryan staff 340 May 25 11:18 src
Bryan#Bryans-MacBook-Pro Thu May 25 12:23:24 ~/go/src/skincarereview
$ sudo go get
Password:
package google.golang.org/appengine: cannot download, $GOPATH not set. For more details see: go help gopath
package google.golang.org/appengine/datastore: cannot download, $GOPATH not set. For more details see: go help gopath
Your $GOPATH is set in your user $PATH, but you are envoking go get using sudo which has its own $PATH different from yours.
To illustrate, try sudo go env and you will see the difference.
You probably shouldn't be using sudo go get anyway though.

Resources