Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

{Linux} Tips and Tricks.

so di ka naka pag install na kahit ano sa os mo? kasi wala kang su or sudo?

Marami na akong nainstall sa OS ko sir. Ok naman to tapos bigal na lang nag karoon ng ganun pag mag roroot na ako. Nkaka access naman ako ng root nung mga nakaraan.

- - - Updated - - -

/etc/sudoers.d ung akin sir tapos README lang ung laman. :(

- - - Updated - - -

/etc/sudoers.d ung akin sir tapos README lang ung laman. :(
 
Marami na akong nainstall sa OS ko sir. Ok naman to tapos bigal na lang nag karoon ng ganun pag mag roroot na ako. Nkaka access naman ako ng root nung mga nakaraan.

- - - Updated - - -

/etc/sudoers.d ung akin sir tapos README lang ung laman. :(

- - - Updated - - -

/etc/sudoers.d ung akin sir tapos README lang ung laman. :(

Yung permission mo dyan ..check mo yung owner ng file ng yung system file, dapat yung /tmp/.X0-lock root yung owner
Code:
ls -l




c

- - - Updated - - -

Marami na akong nainstall sa OS ko sir. Ok naman to tapos bigal na lang nag karoon ng ganun pag mag roroot na ako. Nkaka access naman ako ng root nung mga nakaraan.

- - - Updated - - -

/etc/sudoers.d ung akin sir tapos README lang ung laman. :(

- - - Updated - - -

/etc/sudoers.d ung akin sir tapos README lang ung laman. :(

yung sudoers.d directory yun may file dyan sa etc na sudoers talaga hanapin mo...ito yung maganda ng mano-mano talagang your dea;ling with files...
 
Ano po ilalagay ko sa dulo? Eto po kasi sa akin eh.

# User privilege specification
root ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d
 
Ano po ilalagay ko sa dulo? Eto po kasi sa akin eh.

# User privilege specification
root ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

add mo to sa pinaka dulo

<your user name> ALL=(ALL:ALL) ALL

Yung sa akin jer yung username ko so

jer ALL=(ALL:ALL) ALL

then save

try execute sudo apt-cache search nano

- - - Updated - - -

paki post yung result mo with this command check natin yung permission mo ng .X0-lock na file..
Code:
ls -la
Code:
ls -la cd /tmp

Make sure na naka backup yung importatante na file ng OS mo...Delikado kasi yung ginagawa natin dito..

NOTE: Don't login as root dyan sa GUI/Desktop mo, its forbidden makkasira yan sa user's login. You can use su doon sa tty(ctrl+alt+F1-F6). Kung maari "gksudo" or "gksu" or "su -" yung gagamitin mo in your GUI..

Restart muna then huwag kang papasok doon sa display manager(yung may user-password na prompt) instead press ctrl+alt+F1 then meron black screen pasukin mo yan..Then try to use su kung makakpasok ka ba...Informed me pag nakakpasok ka.

Tagal na akong gumagamit ng debian from squeezy to wheezy di ko pa nararanasan tong problema mo..Di kasi ako mahilig sa desktop to manipulate my system files or install something, doon kasi ako sa TTY(ctrl+alt+F1) palagi. Sudo yung ginagamit ko palagi kasi I didnt need to type exit to go back to non-root mood.

Try mo dito http://codeverge.com/opensuse.org.help.install/it-s-probably-something-simple-but/1886701
 
Last edited:
Eto po ung result sir. Sorry po pala kagabi natulog na ako kasi may pasok pa kinabukasan sa work.

ls: cannot access cd: No such file or directory
/tmp:
total 32
drwxrwxrwt 7 root root 4096 Jun 5 17:13 .
drwxr-xr-x 22 root root 4096 Jun 5 17:11 ..
drwxrwxrwt 2 root root 4096 Jun 5 16:54 .ICE-unix
srwxr-xr-x 1 zhenon22 zhenon22 0 Jun 5 17:07 .lxterminal-socket:0-zhenon22
srwxr-xr-x 1 zhenon22 zhenon22 0 Jun 5 16:54 .menu-cached-:0-zhenon22
drwx------ 2 zhenon22 zhenon22 4096 Jun 5 16:56 .org.chromium.Chromium.VYKP6h
srwxr-xr-x 1 zhenon22 zhenon22 0 Jun 5 16:54 .pcmanfm-socket--0-zhenon22
drwx------ 2 zhenon22 zhenon22 4096 Jun 5 16:56 pulse-PKdhtXMmr18n
drwx------ 2 zhenon22 zhenon22 4096 Jun 5 16:54 ssh-GnTJUXExh0Mu
-r--r--r-- 1 root root 11 Jun 5 16:54 .X0-lock
drwxrwxrwt 2 root root 4096 Jun 5 16:54 .X11-unix

- - - Updated - - -

Tinry ko na po ung sinabi mo sir pero kahit sa tty di ako maka pag root. Un pa rin ang sinasabi. :(
 
Eto po ung result sir. Sorry po pala kagabi natulog na ako kasi may pasok pa kinabukasan sa work.

ls: cannot access cd: No such file or directory
/tmp:
total 32
drwxrwxrwt 7 root root 4096 Jun 5 17:13 .
drwxr-xr-x 22 root root 4096 Jun 5 17:11 ..
drwxrwxrwt 2 root root 4096 Jun 5 16:54 .ICE-unix
srwxr-xr-x 1 zhenon22 zhenon22 0 Jun 5 17:07 .lxterminal-socket:0-zhenon22
srwxr-xr-x 1 zhenon22 zhenon22 0 Jun 5 16:54 .menu-cached-:0-zhenon22
drwx------ 2 zhenon22 zhenon22 4096 Jun 5 16:56 .org.chromium.Chromium.VYKP6h
srwxr-xr-x 1 zhenon22 zhenon22 0 Jun 5 16:54 .pcmanfm-socket--0-zhenon22
drwx------ 2 zhenon22 zhenon22 4096 Jun 5 16:56 pulse-PKdhtXMmr18n
drwx------ 2 zhenon22 zhenon22 4096 Jun 5 16:54 ssh-GnTJUXExh0Mu
-r--r--r-- 1 root root 11 Jun 5 16:54 .X0-lock
drwxrwxrwt 2 root root 4096 Jun 5 16:54 .X11-unix

- - - Updated - - -

Tinry ko na po ung sinabi mo sir pero kahit sa tty di ako maka pag root. Un pa rin ang sinasabi. :(

try mo to http://codeverge.com/opensuse.org.he...le-but/1886701

Oonga pala..Papaano mo na open yung sudoers file? kailangan kasi yun ng sudo or root permision bago ma pasok? Ano ginagamit mo?
 
you're welcome! Pwede mo yun gagawan ng script yung nag wowork na changing your intel/brightness sa sys/ dir value then i assign mo yung keyboard shortcut, para makaa adjust ka on fly..

Ito yung bright script ko..Just replace the setpci with your working command then gawin mong executable at ilagay mo sa /usr/local/bin yung file

Code:
#!/bin/bash

if [ $1 -lt 100 ] && [ $1 -gt 0 ]; then
sudo setpci -s 00:02.0 F4.B="$1"
else
echo "Only numeric value between 1 and 99 are allowed."
fi

To execute it
bright <desired numerical percentage for brightness>
ex. bright 55 then press enter.

sir pano po maglagay ng flags like bright -l ididisplay niya yung current brightness?

- - - Updated - - -

Eto yung ginawa ko. Working naman siya kaso may warning. :lol: line 3 integer expression expected.

Code:
#!/bin/bash
f=/sys/class/backlight/intel_backlight/brightness
if [ $1 -lt 976 ] && [ $1 -gt 0 ]; then
	sudo echo $1 > $f
elif [ "$1"=="-l" ]; then
	cat $f
else
	echo "Enter values from 0-976 only."
fi
 
Last edited:
sir pano po maglagay ng flags like bright -l ididisplay niya yung current brightness?

flags = options
ito yung mag momodify ng default action ng isang command
try mo to
Code:
ls
then this one with -l na flags
Code:
ls -l

so kung gusto mo yung ibang flags ng ls just execute this
Code:
man ls

sa scripts like sa sample ko with brightness instead of flags argument yung ginagamit ko..

try mo to
gawa ka ng empty file sa home directory
name it my_friend.sh
add this code

Code:
#!/bin/bash
echo $1
echo $2
exit 0
make it executable
Code:
chmod +x my_friend.sh

execute mo yung script
syntax <name of script> $1 $2
yung first argument mo hello($1) then yun second audrey($2)
Code:
./my_friend.sh hello audrey

ganyan yung pag bigay ng argument on fly in your script.
 
Last edited:
Eto sir yung ineexpect ko input:
bright -l
bright 300

Yung warning nalang yung problema ko sir. The rest okay na. Actually inaantok na ako kaya wala na akong maintindihan. nireformat ko din kasi laptop ko kaya napuyat ako :lol:
 
Last edited:
@audrey

ito na lang

Code:
#!/bin/bash

re='^[0-9]+$'

if [ $1 = "-l" ]; then
   echo "hello my dear audrey"
elif ! [[ $1 =~ $re ]] ; then
   echo "error: Not a number"
else
   if [ $1 -lt 100 ] && [ $1 -gt 0 ] ; then
      sudo setpci -s 00:02.0 F4.B="$1"
   else
      echo "Only numeric value between 1 and 99 are allowed."
   fi
fi
 
Last edited:
sir pano po maglagay ng flags like bright -l ididisplay niya yung current brightness?

- - - Updated - - -

Eto yung ginawa ko. Working naman siya kaso may warning. :lol: line 3 integer expression expected.

Code:
#!/bin/bash
f=/sys/class/backlight/intel_backlight/brightness
if [ $1 -lt 976 ] && [ $1 -gt 0 ]; then
	sudo echo $1 > $f
elif [ "$1"=="-l" ]; then
	cat $f
else
	echo "Enter values from 0-976 only."
fi

hello...

na-try mo na bang baliktarin condition mo?

tulad nito kung gagana?

Code:
#!/bin/bash
f=/sys/class/backlight/intel_backlight/brightness
if [ "$1"=="-l" ]; then
        cat $f	
elif  [ $1 -lt 976 ] && [ $1 -gt 0 ]; then
        sudo echo $1 > $f	
else
	echo "Enter values from 0-976 only."
fi

Iniisip ko lang... kapag dumaan dun sa 1st condition (i.e. if), talagang mag-eexpect ng number/integer kung hindi number ang ilalagay mo sa $1 (i.e. "-l") at lalabas nga talaga yung ganung error/warning.
 
Last edited:
@muthym

muth she(audrey) is very fragile...Dapat ingatan natin to, bagong lipat galing sa kabila to linux(new linux babes). Bihira lang kasi yung babae na mahilig with CLI...Talo mga lalake dito hehehehehe.


Inopen ko ung file manager sir tapos may open folder as root. Naopen naman.

Kumusta na yung problema mo? Nakakagamit ka na ng sudo?
 
Last edited:
@muthym

muth she(audrey) is very fragile...Dapat ingatan natin to, bagong lipat galing sa kabila to linux(new linux babes). Bihira lang kasi yung babae na mahilig with CLI...Talo mga lalake dito hehehehehe.

Nandiyan ka naman :)

Nawala sa isip ko baliktarin rin yung statements :) teka ayusin ko lang...

- - - Updated - - -

Eto sir yung ineexpect ko input:
bright -l
bright 300

Yung warning nalang yung problema ko sir. The rest okay na. Actually inaantok na ako kaya wala na akong maintindihan. nireformat ko din kasi laptop ko kaya napuyat ako :lol:

Kung ayaw mong galawin yung logic, ayusin lang natin ng konti :) Kung gusto mong i-filter talaga yung numbers, paki-tsek na lang yung kay jer. you have to study regular expressions.

Code:
#!/bin/bash
f=/sys/class/backlight/intel_backlight/brightness

if [ $# == 0 ]; then
	echo "oops... something is missing :)"
	exit
fi

if [ $1 == "-l" ]; then
	cat $f
	exit
elif [ $1 -lt 976 ] && [ $1 -gt 0 ]; then
	sudo echo $1 > $f
	exit
else
	echo "Enter values from 0-976 only."
fi
 
Last edited:
exit did the trick. Salamat po. Nakakatuwa naman ang reception niyo towards female Linux users.

- - - Updated - - -

@jerjerjanjan sang kabila? :lol:
 
Last edited:
exit did the trick. Salamat po. Nakakatuwa naman ang reception niyo towards female Linux users. I'm still new to this but I'll help out here if I can.

- - - Updated - - -

@jerjerjanjan sang kabila? :lol:

Sa kabilang dulo my dear audrey(mac in pc)....
 
Back
Top Bottom