Home » Unix » Page 90

I'm new to rsync. I have a Linux machine with an external
harddrive (ext3) and a Windows machine with an NTFS external
harddrive. I connected the NTFS harddrive to the Linux machine and
did a mirror copy from the ext3 drive. After, I copied some new files
to the ext3 drive and then I connected the NTFS back to the Windows
machine and from cygwin ran:



rsync -Pratluvz user@linux_machine:/path/to/data
/cygdrive/f/


I expected the sync to be really fast since the data is the same
except for the most recent addition. A typical line looks like
this:



Documents/path/to/file.ext
2688670 100% 801.24kB/s 0:00:03 (xfer#1, to-check=2477/12876)


It's taken almost as long to do the initial sync as the copy
itself. However, when I stop the sync and resume, it begins where it
left off. Is the first sync special in that it takes an inventory and
writes to a file? Will later syncs be faster? (I toggled the 'z'
parameter with no effect, and removed the 'c' parameter, which
helped.)

Where can I find firefox log file on Centos 6?



Unfortunately, firefox doesn't write its log in
/var/log/message .

my vServer / webserver (OS: Debian squeeze) got hacked and
compromised. Therefore I want to use rules in IPTable to block all
input and output connections except ssh. Afterwards I want to backup
at least some databases and files, which should be save. I found some
tutorials and scripts describing the workflow, but I still have
questions:



1.) Sine I have no physical access to the server, I'm quite careful
to use this, because I don't want to lock out myself. When I use the
following script with "iptables-restore < /etc/myscript", I should
be still able to connect with SSH from my local machine, right? If
not, is it correct that a restart of the machine should reactivate the
old standard rules?



2.) I'm a little bit confused by rules defining sport & dport
(source & destination port). As written in the script, would it be
possible from a third webserver to connect to the compromised machine?
Because I want to backup the files to another vServer and could
obviously not transfer the files via HTTP.



3.) Probably the most stupid question, but I still want to ask:
Processing the commands of the script line by line, there would be a
complete blocking of all connections after the secong part - the rule
to allow ssh connections is defined in the third part. Since I'm
connected via SSH, shouldn't my connection be disrupted after using
the rules (and before accepting shh)?



# flushing old rules
IPTABLES -F
IPTABLES -X
IPTABLES -t nat -F
IPTABLES -t nat -X

# creating general policy
IPTABLES -P INPUT DROP
IPTABLES -P OUTPUT DROP
IPTABLES -P FORWARD DROP

# allowing SSH
IPTABLES -A OUTPUT -p tcp --dport 22 -m state --state
ESTABLISHED,RELATED -j ACCEPT
IPTABLES -A INPUT -p tcp --sport 22 -j ACCEPT

I’m trying to automatically transcode videos with are begin
uploaded constantly to a server.



That's why I have came up with the idea of using inotify by
checking every moment for new files on the videos folder, by using
this shell script:



#!/bin/bash

inotifywait --monitor -e moved_to -e create /usr/local/share/downloads
| while read dir;
do
(~/convertvideos/convert.sh)

done


When a new file is moved or created over
/usr/local/share/downloads, it called to another script
over ~/convertvideos/convert.sh.



The idea of the convert.sh file is to convert every video which is
within the /usr/local/share/download directory, and
within every single folder.



The contents of convert.sh is:



#!/bin/bash
for file in /usr/local/share/downloads/*
do ffmpeg -i "$file" -acodec aac -ac 2 -ar 44100 -ab 128k -strict -2
-vcodec libx264 "$file".mp4 < /dev/null
rm "$file"

done


ON my server for the first files within the /downloads/ folder
works, but after it finishes transcoding it starts again transcoding
the same files, and for example if there is one folder down, let say
/downloads/Anthony Zimmer FRENCH/ it should search for
any video file and transcode it. After that it should delete the non
transcoded file. and perhaps move the transcoded file to another
folder.



How can I get this to work?

I loaded UBUNTU onto a shrunken partition on my laptop running Win
7 Pro.
I didn't let it finish downloading all its updates/downloads during
installation.
I ran Ubuntu and it didn't work right but it did load.
I thought I could delete the partition and start over by reinstalling
Ubuntu.
I booted into windows and deleted the partition with Ubuntu on it
intending to reinstall it right then I had to shut down my laptop to
get out of the doctors office in a hurry.



Now all I get is:



error:no such partition
grub rescue>


How can I recover from this?

I have an old iPod classic (2006 model, I believe) and I recently
built my own computer, thus transitioning away from my old iMac and
moving onto my own Fedora 21 desktop.



Despite my negative opinion about Apple, I still believe that the
iPod classic was one of their best creations, and I was wanting to
make it sync music between my Fedora desktop and the iPod. However, it
seems that Rhythmbox is having issues syncing the device. Whenever I
attempt to sync the iPod, my screen is polluted with approximately
200+ alert boxes saying the sync operation failed to perform because
the device is read-only.



I am confused, because as far as I know, it is mounted correctly. I
imagine the fault lies in the Mac OS Journaled format or something
similar.



Is there any way I can resolve this issue without wiping the iPod
classic clean? If not, what is the best way I should go about wiping
the iPod: through iTunes on the Mac, through the Disks
application in GNOME, or something like Gpartition?



Or, alternatively, is there perhaps a program better than Rhythmbox
for handling iPod classics that I could try?

File 1:



01  08                                                 
2014-12-08 04 5000
01 01 **90488305** 00000 001 2014-12-04 01:21:28
**2014-12-08** 04 001 04 **5000**
02 01 90488305 00000 001 00001 0020130 8411 5856853820026
00000 00
03 01 90488305 00000 001 00002 000 19 0000000000000000
000000 4 0000000 0000795
06 01 90488305 00000 001 00448 0006400 0006848 001
0006400 1 00000 0000000 00000
07 01 90488305 00000 001 7806765448990026 05 0006848
00001 010101 **OK109C** 0428 00010101
01 09 2014-12-08
04 5000
01 02 90488306 00000 001 2014-12-04 01:21:30 2014-12-08
04 001 04 5000
02 02 90488306 00000 001 00001 0020130 8411 5856853820026
00000 00
03 02 90488306 00000 001 00002 000 19 0000000000000000
000000 4 0000000 0000795
06 02 90488306 00000 001 00448 0006400 0006848 001
0006400 1 00000 0000000 00000
07 02 90488306 00000 001 7806765448990026 05 0006848
00001 010101 OK111C 0428 00010101


File 2:



123345                                                     
/

/COLUMBUS

/OH /43213 /US /OH /US
/21/00 /
**50002014-12-08OK109C90488305**
BBARD /9010 /E /C


SCENERIO:




  • File 1 is tab delimited and contains data that goes through line
    01 to line 07.

  • You can see that the 2nd line of the File 2 is the combination of
    the Column 13 (line 01) + Column 8 (line 01) + Column 12 (line 07) +
    Column 3 (line 01) of File 1.
    (i.e. 5000 + 2014-12-08 + OK109C + 90488305)



REQUIREMENT:



This is a tough one.
I need an awk script that can



1) Create a File3.txt in the following
format even if key matches or not.
Complete record of File 1 till line 07 + a new line with prefix 99 and
then tab and Complete string from File 2.
So if there is No Match of key, then it would put available
information from File 1 or File 2 and skip the missing
information.



DESIRED OUTPUT:



01  01  90488305    00000   001 2014-12-04  01:21:28   
2014-12-08 04 001 04 5000
02 01 90488305 00000 001 00001 0020130 8411 5856853820026
00000 00
03 01 90488305 00000 001 00002 000 19 0000000000000000
000000 4 0000000 0000795
06 01 90488305 00000 001 00448 0006400 0006848 001
0006400 1 00000 0000000 00000
07 01 90488305 00000 001 7806765448990026 05 0006848
00001 010101 OK109C 0428 00010101

99 123345
/

/COLUMBUS

/OH /43213 /US /OH /US /21/00
/
50002014-12-08OK109C90488305
BBARD /9010 /E /C


2) Match File 1 columns combination (i.e.
5000 + 2014-12-08 + OK109C + 90488305) against the line
in file 2 (50002014-12-08OK109C90488305) and if there is
no match then copy that information from File 1 and File 2 in the same
format above and put in File4.txt.

This is the CRON log case computer that runs some
scripts (internet-connections oriented):



luis@Fostrot:~$ sudo tail -n 50 /var/log/syslog | grep
"cron" -i
Jan 19 21:30:01 Fostrot /USR/SBIN/CRON[11014]: (root) CMD (/bin/bash
--login -i -c Reconectador3G.sh)
Jan 19 21:30:01 Fostrot /USR/SBIN/CRON[11013]: (root) CMD (/bin/bash
--login -i -c ReportarIP.sh)
Jan 19 21:30:01 Fostrot /USR/SBIN/CRON[11015]: (root) CMD (
/bin/ReconectadorVPN.sh)
Jan 19 21:35:01 Fostrot /USR/SBIN/CRON[11224]: (root) CMD (/bin/bash
--login -i -c Reconectador3G.sh)
Jan 19 21:35:01 Fostrot /USR/SBIN/CRON[11227]: (root) CMD (/bin/bash
--login -i -c ReportarIP.sh)
Jan 19 21:35:01 Fostrot /USR/SBIN/CRON[11225]: (root) CMD (
/bin/ReconectadorVPN.sh)
Jan 19 21:39:01 Fostrot /USR/SBIN/CRON[11452]: (root) CMD ( [ -x
/usr/lib/php5/maxlifetime ] && [ -x /usr/lib/php5/sessionclean
] && [ -d /var/lib/php5 ] &&
/usr/lib/php5/sessionclean /var/lib/php5 $(/usr/lib/php5/maxlifetime))
Jan 19 21:40:01 Fostrot /USR/SBIN/CRON[11477]: (root) CMD (
/bin/ReconectadorVPN.sh)
Jan 19 21:40:01 Fostrot /USR/SBIN/CRON[11478]: (root) CMD (/bin/bash
--login -i -c Reconectador3G.sh)
Jan 19 21:40:01 Fostrot /USR/SBIN/CRON[11481]: (root) CMD (/bin/bash
--login -i -c ReportarIP.sh)
Jan 19 21:45:01 Fostrot /USR/SBIN/CRON[11832]: (root) CMD (/bin/bash
--login -i -c ReportarIP.sh)
Jan 19 21:45:01 Fostrot /USR/SBIN/CRON[11831]: (root) CMD (
/bin/ReconectadorVPN.sh)
Jan 19 21:45:01 Fostrot /USR/SBIN/CRON[11833]: (root) CMD (/bin/bash
--login -i -c Reconectador3G.sh)


And this is the crontab for sudo:



luis@Fostrot:~$ sudo crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
*/5 * * * * /bin/bash --login -i -c Reconectador3G.sh
*/5 * * * * /bin/bash --login -i -c ReportarIP.sh


As you can see, there is no entry for
ReconectadorVPN.sh.
The other users have no crontab, or so it seems:



luis@Fostrot:~$ crontab -l
no crontab for luis


I have even checked the crontab for all users:



root@Fostrot:/home/luis# awk -F: '{print $1}' /etc/passwd |
xargs -l1 crontab -lu
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
*/5 * * * * /bin/bash --login -i -c Reconectador3G.sh
*/5 * * * * /bin/bash --login -i -c ReportarIP.sh
no crontab for daemon
no crontab for bin
no crontab for sys
no crontab for sync
no crontab for games
no crontab for man
no crontab for lp
no crontab for mail
no crontab for news
no crontab for uucp
no crontab for proxy
no crontab for www-data
no crontab for backup
no crontab for list
no crontab for irc
no crontab for gnats
no crontab for nobody
no crontab for libuuid
no crontab for mysql
no crontab for messagebus
no crontab for colord
no crontab for usbmux
no crontab for miredo
no crontab for ntp
no crontab for Debian-exim
no crontab for avahi
no crontab for beef-xss
no crontab for dradis
no crontab for pulse
no crontab for speech-dispatcher
no crontab for haldaemon
no crontab for iodine
no crontab for postgres
no crontab for sshd
no crontab for snmp
no crontab for stunnel4
no crontab for statd
no crontab for sslh
no crontab for Debian-gdm
no crontab for rtkit
no crontab for saned
no crontab for manolo
no crontab for luis
no crontab for dnsmasq
no crontab for arpwatch
no crontab for redsocks


... and none of them have entry for the
ReconectadorVPN.sh script.



What is going on here and how could I locate the
call
to the ReconectadorVPN.sh script?

I'm a newbie to Linux so please forgive me for asking
such stupid question!



I'd installed jdk1.7.0.rpm package in
RHEL6.

Where I do find the path and to execute my
first java program?

I recently updated my Linux Mint Debian Edition to update pack 7.
Since then, every time I change the volume by scrolling on the volume
applet that is on my panel, an annoying beep is played. Similar to the
behavior of OSX when changing volume.



I have never understood the point of this, it means I cannot change
volume silently and it is extremely annoying. I have checked
Cinnamon's sound preferences (and Gnome's, just in case since there is
some overlap) and also the pulse audio settings. I have notifications
set to off in Cinnamon's sound preferences. I also checked volume
applets tab in Cinnamon's settings but the volume applet has no
options.



So, how can I remove this annoying beep and get my silent system
back?


- Technology - Languages
+ Webmasters
+ Development
+ Development Tools
+ Internet
+ Mobile Programming
+ Linux
+ Unix
+ Apple
+ Ubuntu
+ Mobile & Tablets
+ Databases
+ Android
+ Network & Servers
+ Operating Systems
+ Coding
+ Design Software
+ Web Development
+ Game Development
+ Access
+ Excel
+ Web Design
+ Web Hosting
+ Web Site Reviews
+ Domain Name
+ Information Security
+ Software
+ Computers
+ Electronics
+ Hardware
+ Windows
+ PHP
+ ASP/ASP.Net
+ C/C++/C#
+ VB/VB.Net
+ JAVA
+ Javascript
+ Programming
Privacy Policy - Copyrights Notice - Feedback - Report Violation 2018 © BigHow