Thursday 17 August 2017

How to delete files with strange characters

If you have files that you can not delete due to strange characters, find the inode and delete them via that.
root@server puppetlabs # ls
activemq      code          enterprise                        installer    license.key.2016  orchestration-services  puppetserver  r10k
client-tools  code-staging  --exclude-dirs=code,code-staging  license.key  mcollective       puppet                  pxp-agent
[2017-08-17 16:03:42]
root@server puppetlabs # rm --exclude-dirs\=code\,code-staging
rm: unrecognized option '--exclude-dirs=code,code-staging'
Try 'rm ./'--exclude-dirs=code,code-staging'' to remove the file ‘--exclude-dirs=code,code-staging’.
Try 'rm --help' for more information.
[2017-08-17 16:02:30]
No chance with the above, so use:
root@server puppetlabs # ls -i
918314 activemq      918427 code-staging                      917739 installer         918184 mcollective             918048 puppetserver
918293 client-tools  918390 enterprise                        945600 license.key       918298 orchestration-services  918212 pxp-agent
918146 code          927457 --exclude-dirs=code,code-staging  934089 license.key.2016  918195 puppet                  918294 r10k
[2017-08-17 16:04:36]
root@server puppetlabs # find . -inum 927457 -delete
[2017-08-17 16:04:59]
root@picard puppetlabs # ls
activemq      code          enterprise  license.key       mcollective             puppet        pxp-agent
client-tools  code-staging  installer   license.key.2016  orchestration-services  puppetserver  r10k
[2017-08-17 16:04:59]

Friday 4 August 2017

iSCSI on Oracle Linux

Install the iSCSI utils:
# yum install iscsi-initiator-utils
Check out the initiator file to get the IQN:
# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.1988-12.com.oracle:acbd8bf16757